Python: Pass or Sleep for long running processes?

前端 未结 7 1309
情书的邮戳
情书的邮戳 2020-11-30 05:10

I am writing an queue processing application which uses threads for waiting on and responding to queue messages to be delivered to the app. For the main part of the applica

相关标签:
7条回答
  • 2020-11-30 06:08

    Why sleep? You don't want to sleep, you want to wait for the threads to finish.

    So

    # store the threads you start in a your_threads list, then
    for a_thread in your_threads:
        a_thread.join()
    

    See: thread.join

    0 讨论(0)
提交回复
热议问题