[New-bugs-announce] [issue16560] Python sighandlers delayed for no reason

Zdenek Pavlas report at bugs.python.org
Mon Nov 26 18:12:00 CET 2012


New submission from Zdenek Pavlas:

Quoting from "signal" module docs:

# Although Python signal handlers are called asynchronously as far as the Python user is concerned, they can only occur between the “atomic” instructions of the Python interpreter.

Yes, that's reasonable.

# This means that signals arriving during long calculations implemented purely in C (such as regular expression matches on large bodies of text) may be delayed for an arbitrary amount of time.

IMO, A does not imply B.  Long computation in C with GIL released does not need to be atomic, as it happens "between" Python instructions.  

The thunk that's called asynchronously should preempt the C computation and issue a Python callback when possible.  Otherwise, Python handlers are useless when interfacing C code.

----------
components: Interpreter Core
files: trip-signal.patch
keywords: patch
messages: 176428
nosy: zdenek.pavlas
priority: normal
severity: normal
status: open
title: Python sighandlers delayed for no reason
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file28133/trip-signal.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16560>
_______________________________________


More information about the New-bugs-announce mailing list