| Store | Cart

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

From: R. David Murray <rdmu...@bitdance.com>
Mon, 01 Sep 2014 11:47:07 -0400
On Mon, 01 Sep 2014 14:15:52 +0300, Marko Rauhamaa <mar...@pacujo.net> wrote:
> Charles-François Natali <cf.n...@gmail.com>:> > >> Which raises an interesting question: what happens to the os.read()> >> return value if SIGINT is received?> >> > There's no return value, a KeywordInterrupt exception is raised.> > The PEP wouldn't change this behavior.> > Slightly disconcerting... but I'm sure overriding SIGINT would cure> that. You don't want to lose data if you want to continue running.> > > As for the general behavior: all programming languages/platforms> > handle EINTR transparently.> > C doesn't. EINTR is there for a purpose. I sure hope Python won't bury> it under opaque APIs.> > 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".

>  * Don't lose information.> > > Marko> _______________________________________________> Python-Dev mailing list> Pyth...@python.org> https://mail.python.org/mailman/listinfo/python-dev> Unsubscribe: https://mail.python.org/mailman/options/python-dev/rdmurray%40bitdance.com

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Victor Stinner Aug 31, 2014 12:44 pm
Marko Rauhamaa Aug 31, 2014 03:19 pm
Victor Stinner Aug 31, 2014 08:59 pm
Marko Rauhamaa Aug 31, 2014 09:19 pm
Ethan Furman Aug 31, 2014 09:38 pm
Marko Rauhamaa Aug 31, 2014 10:15 pm
Antoine Pitrou Aug 31, 2014 10:37 pm
Victor Stinner Aug 31, 2014 10:45 pm
Greg Ewing Sep 01, 2014 07:15 am
Antoine Pitrou Sep 01, 2014 12:46 pm
Victor Stinner Aug 31, 2014 09:38 pm
Marko Rauhamaa Aug 31, 2014 10:04 pm
Victor Stinner Aug 31, 2014 10:36 pm
Greg Ewing Aug 31, 2014 10:28 pm
Dan Stromberg Sep 01, 2014 03:14 am
R. David Murray Sep 01, 2014 04:51 am
Marko Rauhamaa Sep 01, 2014 05:30 am
R. David Murray Sep 01, 2014 03:42 pm
Marko Rauhamaa Sep 01, 2014 03:59 pm
Victor Stinner Sep 01, 2014 07:27 am
Paul Moore Sep 01, 2014 06:12 am
Victor Stinner Sep 01, 2014 07:18 am
Marko Rauhamaa Sep 01, 2014 07:38 am
Charles-François Natali Sep 01, 2014 10:40 am
Marko Rauhamaa Sep 01, 2014 11:15 am
Charles-François Natali Sep 01, 2014 11:25 am
R. David Murray Sep 01, 2014 03:47 pm
Antoine Pitrou Sep 01, 2014 03:51 pm
Marko Rauhamaa Sep 01, 2014 04:00 pm
Antoine Pitrou Sep 01, 2014 12:58 pm
Matthew Woodcraft Sep 01, 2014 09:17 pm
Nick Coghlan Sep 02, 2014 12:23 pm
Matthew Woodcraft Sep 02, 2014 09:02 pm
Victor Stinner Sep 02, 2014 09:35 pm
Antoine Pitrou Sep 02, 2014 02:48 pm
Matthew Woodcraft Sep 02, 2014 09:03 pm
Victor Stinner Sep 02, 2014 09:40 pm
Matthew Woodcraft Sep 03, 2014 08:26 pm
Messages in this thread