Python threads don't run simultaneously

后端 未结 1 369
再見小時候
再見小時候 2021-01-05 18:23

I\'m brand new to multi-threaded processing, so please forgive me if I butcher terms or miss something obvious.

The code below doesn\'t offer any time advantage over

1条回答
  •  被撕碎了的回忆
    2021-01-05 18:36

    There are good answers regarding the GIL you can look at.

    In short, if your tasks are CPU-bound (like the ones you posted), threads are not going to help you. Python threads are good for IO-bound tasks, like retrieving a web page.

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