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
title: Python sighandlers delayed for no reason
versions: Python 2.7
Added file: http://bugs.python.org/file28133/trip-signal.patch
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list