[issue7946] Convoy effect with I/O bound threads and New GIL
report at bugs.python.org
Mon Apr 26 13:08:47 CEST 2010
David Beazley <dave at dabeaz.com> added the comment:
I like the idea of the monitor suspending if no thread owns the GIL. Let me work on that. Good point on embedded systems.
Yes, the gil monitor is completely independent and simply ticks along every 5 ms. A worst case scenario is that an I/O bound thread is scheduled shortly after the 5ms tick and then becomes CPU-bound afterwards. In that case, the monitor might let it run up to about 10ms before switching it. Hard to say if it's a real problem though---the normal timeslice on many systems is 10 ms so it doesn't seem out of line.
As for the priority part, this patch should have similar behavior to the glinter patch except for very subtle differences in thread scheduling due to the use of the GIL monitor. For instance, since threads never time out on the condition variable anymore, they tend to cycle execution in a purely round-robin fashion.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list