Home > other >  Python is used in the queue for producers to consumers, how to stop
Python is used in the queue for producers to consumers, how to stop

Time:02-21

In python queue is thread-safe, will be blocked if the queue is empty,
So when I was a producer threads to queue into goods, ten consumer threads, take out the goods from the queue,
I see someone is written by consumers while True
How do I let the producers no longer production, consumers don't stop running after processing the data in the queue,
Thank you,
  • Related