[zeromq-dev] CZMQ zctx_new signal handler side effect
Philip Kovacs
kovacsp3 at comcast.net
Thu Dec 22 05:59:58 CET 2011
I'm wondering if czmq's installation of signal handers as a side effect
of creating a context with zctx_new is ideal.
If you run a reactor (zloop) in the main thread, I can see where the signal
handling is helpful, but consider the case where you run zloops in attached
threads. If the process gets a SIGTERM or SIGINT, the attached threads
shutdown cleanly, but the main thread ends up in an unexpected state.
You can have the main thread regain control of signal handling, of course,
by using sigaction after each zctx_new, but in that case, you are fighting
the czmq library.
It might be better to add a separate (optional) method for installing signal
processing within czmq, rather than forcing the behavior as a side effect.
Anyone have any thoughts on this?
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20111221/09a93dc9/attachment.sig>
More information about the zeromq-dev
mailing list