Order the steps
Order a clean producer-consumer run.
- Create a bounded queue and start N worker tasks
- Producer awaits put() for each item
- Stop the workers (cancel or Queue.shutdown)
- Workers process items and call task_done()
- Await queue.join()
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A B D E C
- Create a bounded queue and start N worker tasks Workers wait on get().
- Producer awaits put() for each item Waits when the queue is full.
- Workers process items and call task_done() Counts completed work.
- Await queue.join() Returns when all items are done.
- Stop the workers (cancel or Queue.shutdown) Clean exit.