* Pieter Hintjens <[email protected]> [2011-12-22 00:45:43 -0600]: > On Wed, Dec 21, 2011 at 10:59 PM, Philip Kovacs <[email protected]> wrote: > > > 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. > > Hmm, it is true that shutting down a multithreaded app is delicate. > You need to inform the parent thread via its pipe, and the parent > needs to then exit explicitly. I don't think it would help to have > signals caught by the parent; you would then get child threads not > exiting properly.
Yeah, but then you create an obligation on the part of the main thread to poll its side of the pipe also.... Phil
signature.asc
Description: Digital signature
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
