[zeromq-dev] Signal handling in blocking zmq_recv
Martin Lucina
mato at kotelna.sk
Wed Mar 10 22:52:06 CET 2010
Brian,
ellisonbg at gmail.com said:
> At that point, Python raised KeyboardError (the default sig handler
> raises that for ctrl-C). This simple experiment show that:
>
> 1. Python's signal handler is still installed and working properly.
> 2. When blocking on zmq_recv, the Python interpreter is "not in
> control." (the 0MQ C++ code is running) and thus can't respond to the
> signal until it gets control.
>
> Thus, I think the only way of resolving this if 0MQ is making out
> signals in the IO threads. Thoughts?
What you're saying is that the Python signal handler receives the signal,
queues some kind of internal flag indicating "a signal was received" but
doesn't actually *act on* the signal until the 0MQ C++ code returns to the
Python binding, and the Python binding returns control to the Python
interpreter.
Do I understand you correctly?
-mato
More information about the zeromq-dev
mailing list