[Python-Dev] "Fixing" the new GIL

Antoine Pitrou solipsis at pitrou.net
Tue Mar 16 13:00:11 CET 2010


Hi Kristján,

> In the new GIL, there appear to be several problems:
> 1) There is no FIFO queue of threads wanting the queue, thus thread
> scheduling becomes non-deterministic

Thread scheduling has always been non-deterministic.

> 2) The "ticking" of the GIL is
> now controled by a condition variable timeout.  There appears to be
> no way to prevent many such timeouts to be in progress at the same
> time, thus you may have an unnecessarily high rate of ticking going
> on.

Unless there's a bug, no, there isn't.

> 3) There isn't an immediate gil request made when an IO thread
> requests the gil back, only after an initial timeout.

This is what we are looking to fix (perhaps).

> What we are trying to write here is a thread scheduler, and that is
> complex business. K

I would have rephrased:
"What we are trying to avoid here is a thread scheduler".

regards

Antoine.




More information about the Python-Dev mailing list