3 ms·
Hmm, that's interesting, thank you. I didn't realize extensions can control the GIL.
by stavros 2y ago
Hmm, that's interesting, thank you. I didn't realize extensions can control the GIL.
- dagenix 2y agoYup, I think its described here: https://docs.python.org/3/c-api/init.html#releasing-the-gil-from-extension-code https://docs.python.org/3/c-api/init.html#releasing-the-gil-.... My understanding, is that many extensions will release the GIL when doing anything expensive. So, if you are doing CPU or IO bound operations in an extension _and_ you are calling that operation in multiple threads, even with the GIL you can potentially fully utilize all of the CPUs in your machine.