[issue8299] Improve GIL in 2.7

Kristján Valur Jónsson report at bugs.python.org
Thu Apr 15 19:23:16 CEST 2010


Kristján Valur Jónsson <kristjan at ccpgames.com> added the comment:

David, I urge you to reconsider:
The "emulated" semaphore is broken because it is unfair.  It is clearly a programming error, born out of naivete about how to implement such primitives.  Proper semaphores therefore cannot be implemented using the "exact same mechanism" because proper semaphores are fair, this one isn't.  You do understand why exactly it is unfair, don't you?

Second, with a fair GIL you still get poor performance on multicore with low values of "tickinterval" but at least you get predictable scheduling.  The emulated semaphore is bad in two ways:  Unpredictable scheduling with thread starvation _and_ poor multicore performance.  I don't understand why you prefer having two problems to one.

I also think it is worth investigating when exactly the "emulaton" semaphore became the "standard".  Did something break in the config script at some point?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8299>
_______________________________________


More information about the Python-bugs-list mailing list