Python Global Interpreter Lock (GIL) workaround on multi-core systems using taskset on Linux?

后端 未结 7 1278
攒了一身酷
攒了一身酷 2020-12-02 11:25

So I just finished watching this talk on the Python Global Interpreter Lock (GIL) http://blip.tv/file/2232410.

The gist of it is that the GIL is a pretty good design

相关标签:
7条回答
  • 2020-12-02 12:20

    I've found the following rule of thumb sufficient over the years: If the workers are dependent on some shared state, I use one multiprocessing process per core (CPU bound), and per core a fix pool of worker threads (I/O bound). The OS will take care of assigining the different Python processes to the cores.

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