[Python-Dev] RFC: PEP 475, Retry system calls failing with EINTR

Antoine Pitrou solipsis at pitrou.net
Mon Sep 1 17:51:16 CEST 2014


On Mon, 01 Sep 2014 11:47:07 -0400
"R. David Murray" <rdmurray at bitdance.com> wrote:
> > 
> > The two requirements are:
> > 
> >  * Allow the application to react to signals immediately in the main
> >    flow.
> 
> You don't want to be writing your code in Python then.  In Python
> you *never* get to react immediately to signals.  The interpreter
> sets a flag and calls the python signal handler later.  Yes, the
> call is ASAP, but ASAP is *not* "immediately".

Especially if the signal is delivered to another thread (which is
OS-dependent), and the main thread is blocked in *another* system
call ;-)

Regards

Antoine.




More information about the Python-Dev mailing list