[Python-Dev] Signals+Threads (PyGTK waking up 10x/sec).
Guido van Rossum
guido at python.org
Sat Dec 8 18:25:28 CET 2007
On Dec 8, 2007 9:20 AM, Guido van Rossum <guido at python.org> wrote:
> The
> handler must be written in C in order to avoid the race condition
> referred to by Glyph (signals arriving after the signal check in the
> VM main loop but before the select()/poll() system call is entered
> will not be noticed until the select()/poll() call completes).
Sorry, I misattributed this; Gustavo Carneiro pointed this out earlier
in this thread.
BTW, in the referenced post (also by Gustavo), I found this:
"""
According to [1], all python needs to do to avoid this problem is
block all signals in all but the main thread; then we can guarantee
signal handlers are always called from the main thread, and pygtk
doesn't need a timeout.
[1] https://bugzilla.redhat.com/bugzilla/process_bug.cgi#c3
"""
Unfortunately I can't read [1] without having registered, so I can
only guess what it says. But I know that Python already ensures that
signals are only delivered to the main thread. What am I missing?
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list