[Python-Dev] Signals+Threads (PyGTK waking up 10x/sec).

Adam Olsen rhamph at gmail.com
Tue Dec 11 00:28:18 CET 2007


On Dec 10, 2007 4:26 PM, Guido van Rossum <guido at python.org> wrote:
> > Adam & I are now on #python-dev. Can you join?
>
> I think we successfully resolved this. Adam Olsen will produce a patch
> that allows one to specify a single file descriptor to which a zero
> byte will be written by the C-level signal handler. Twisted and PyGTK
> will have to coordinate about this file descriptor. Glyph believes
> this is possible and sufficient.

http://bugs.python.org/issue1583

>
> (A preliminary version of the patch may be found here:
> http://dpaste.com/27576/ )
>
> We considered two alternatives:
>
> (a) A patch by myself where the file descriptor would instead be
> passed together with a signal handler. This was eventually rejected
> because it places an extra burden on every piece of code that
> registers a signal handler.
>
> (b) A more elaborate patch by Adam which would allow many file
> descriptors to be registered. This was rejected for being more code
> and solving a problem that most likely doesn't exist (multiple
> independent main loops running in different threads).
>
> We also located the exact source of the 100 msec timeout in PyGTK:
>
> http://svn.gnome.org/viewvc/pygtk/trunk/gtk/gtk.override?annotate=2926
>
> line 1075: *timeout = 100;
>
> The recommendation for the OLPC XO project is to remove this line or
> make the timeout much larger, as the only reason why this was even
> added to PyGTK is wanting a fast response to ^C from the console,
> which doesn't represent a viable use case on the XO.
>
>
> --
> --Guido van Rossum (home page: http://www.python.org/~guido/)
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/rhamph%40gmail.com
>



-- 
Adam Olsen, aka Rhamphoryncus


More information about the Python-Dev mailing list