On 8 August 2015 at 19:32, Laura Creighton <l...@openend.se> wrote: > I am reading 18.8.1.1 and 18.8.1.2 in > https://docs.python.org/3/library/signal.html which clearly is written > from the CPython point of view. > > ....A Python signal handler does not get executed inside the low-level > (C) signal handler. Instead, the low-level signal handler sets a flag > which tells the virtual machine to execute the corresponding Python > signal handler at a later point(for example at the next bytecode > instruction) ... Python signal handlers are always executed in the > main Python thread, even if the signal was received in another thread ... > > But is this part of the language definition? Or an implementation detail?
Since Python does not define a concept of signal-safe, I guess in practice the handler must be observed to run at a later point. The thread that a handler runs in can be semantically significant; I think you should be able to rely on the behaviour of the signal module in this regard. Different APIs and semantic-preserving optimisations aside. -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely MAY reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to DENY YOU THOSE RIGHTS would be illegal without prior contractual agreement. _______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev