3 ms·
Mutex and a shared condition variable are expensive compared to the single instruction. But I had an impression that it is acquired before every atomic Python
by eveningcoffee 11y ago
Mutex and a shared condition variable are expensive compared to the single instruction.
But I had an impression that it is acquired before every atomic Python instruction and it looks that it is actually acquired for group of predefined number of instructions (100) that then are executed inside one GIL time frame [0].
Therefore it actually should not be a big obstacle to make Python code run fast by a JIT compiler.
[0] http://www.dabeaz.com/python/GIL.pdf http://www.dabeaz.com/python/GIL.pdf