[issue8299] Improve GIL in 2.7
Martin v. Löwis
report at bugs.python.org
Sun Apr 18 17:39:51 CEST 2010
Martin v. Löwis <martin at v.loewis.de> added the comment:
> Martin, I don't know if you were suggesting that a "fair" mutex would
> make the emulated semaphore fair too. You probably weren't, but just
> in case, the fairness of the mutex is immaterial because it is only
> held for a short time to guard the internal state of the "semaphore".
> You won't see threads queing up on it, but they will queue on the
> Contition variable.
Exactly so. I still don't see why you then infer that the GIL is unfair.
It is not IF THE CONDITION VARIABLE IS FAIR. As I said, some
implementations of condition variables *are* fair, e.g. the Linux one
(which in itself isn't really relevant here, because Linux uses the
semaphore GIL, anyway). However, it remains unclear why you think that
the GIL is not fair in pthreads.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list