Python Threading — Threads not starting

后端 未结 2 335
情书的邮戳
情书的邮戳 2021-01-13 14:34

I\'m quite new to the threading module, but my problem is that threads appear to not start.I tried to use the currentThread function to see is they are new threads starting

相关标签:
2条回答
  • 2021-01-13 15:08

    What thread.join() does is it waits for the thread to end what it's doing. To allow other threads to start, move this line to the end of the procedure.

    0 讨论(0)
  • 2021-01-13 15:09
    1. current_thread() returns main thread because you invoke it in the main method. The line printed from the method "basicThread" denotes the actual thread that runs that method ( which are the newly formed threads).

    2. Move the thread_1.join() to the bottom as in the previous answer

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