List Info

Thread: Re: Signals+Threads (PyGTK waking up 10x/sec).




Re: Signals+Threads (PyGTK waking up 10x/sec).
country flaguser name
United States
2007-12-14 16:12:58
On Sat, Dec 08, 2007, glyphdivmod.com wrote:
> On 05:20 pm, guidopython.org wrote:
>>
>>The best solution I can think of is to add a new API
that takes a
>>signal and a file descriptor and registers a C-level
handler for that
>>signal which writes a byte to the file descriptor.
You can then create
>>a pipe, connect the signal handler to the write end,
and add the read
>>end to your list of file descriptors passed to
select() or poll(). 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).
> 
> This paragraph jogged my memory.  I remember this exact
solution being 
> discussed now, a year ago when I was last talking about
these issues.

Ayup.  I am extremely far from an expert here, but anyone
wanting to
have an informed opinion should really re-read the threads
after these
posts:
http://mail.python.org/pipermail/python-de
v/2006-September/068569.html
http://mail.python.org/pipermail/python-dev/
2007-January/070772.html

I would recommend requesting review from either Nick
Maclaren or Tim
Peters as well.
-- 
Aahz (aahzpythoncraft.com)           <*>         http://www.pythoncraft.co
m/

"Typing is cheap.  Thinking is expensive."  --Roy
Smith
_______________________________________________
Python-Dev mailing list
Python-Devpython.org
ht
tp://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/p
ython-dev/nessto%40sharedlog.com

Re: Signals+Threads (PyGTK waking up 10x/sec).
user name
2007-12-14 16:25:49
On Dec 14, 2007 2:12 PM, Aahz <aahzpythoncraft.com> wrote:
> On Sat, Dec 08, 2007, glyphdivmod.com wrote:
> > On 05:20 pm, guidopython.org wrote:
> >>
> >>The best solution I can think of is to add a
new API that takes a
> >>signal and a file descriptor and registers a
C-level handler for that
> >>signal which writes a byte to the file
descriptor. You can then create
> >>a pipe, connect the signal handler to the write
end, and add the read
> >>end to your list of file descriptors passed to
select() or poll(). 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).
> >
> > This paragraph jogged my memory.  I remember this
exact solution being
> > discussed now, a year ago when I was last talking
about these issues.
>
> Ayup.  I am extremely far from an expert here, but
anyone wanting to
> have an informed opinion should really re-read the
threads after these
> posts:
> http://mail.python.org/pipermail/python-de
v/2006-September/068569.html
> http://mail.python.org/pipermail/python-dev/
2007-January/070772.html
>
> I would recommend requesting review from either Nick
Maclaren or Tim
> Peters as well.

Oh no, not Nick Maclaren!

Anyway, did you see that we resolved this and have a patch
ready for review?

http://bugs.python.o
rg/issue1583

-- 
--Guido van Rossum (home page: http://www.python.org/~
guido/)
_______________________________________________
Python-Dev mailing list
Python-Devpython.org
ht
tp://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/p
ython-dev/nessto%40sharedlog.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )