[issue7946] Convoy effect with I/O bound threads and New GIL

David Beazley report at bugs.python.org
Tue Mar 16 03:36:35 CET 2010


David Beazley <dave at dabeaz.com> added the comment:

You know, I almost wonder whether this whole issue could be fixed by just adding a user-callable function to optionally set a thread priority number.  For example:

    sys.setpriority(n)

Modify the new GIL code so that it checks the priority of the currently running thread against the priority of the thread that wants the GIL.  If the running thread has lower priority, it immediately drops the GIL. 

Other than having this added preemption, do nothing else---just throw it all back to the user to come up with the proper "priorities." 

If there was something like this, it would completely fix the overlapped  compute and I/O problem I mentioned.  I'd just set a higher priority on the background I/O threads and be done with it.  Problem solved.

Ok, it's only a thought.

----------

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


More information about the Python-bugs-list mailing list