[zeromq-dev] [patch] handle SIGPIPE
Steven McCoy
steven.mccoy at miru.hk
Wed Jul 7 09:55:09 CEST 2010
On 7 July 2010 15:03, Martin Lucina <mato at kotelna.sk> wrote:
> I don't have the code handy right now, look for the call to
> pthread_sigmask(). The signal mask is cleared for all 0MQ I/O threads,
> so they will not get any signals (excepting SIGSEGV, etc.)
>
>
#if !defined ZMQ_HAVE_OPENVMS
// Following code will guarantee more predictable latecnies as it'll
// disallow any signal handling in the I/O thread.
sigset_t signal_set;
int rc = sigfillset (&signal_set);
errno_assert (rc == 0);
rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL);
errno_assert (rc == 0);
#endif
So the I/O threads which are created by ZeroMQ explicitly ignore all signals
but SIGKILL and SIGSTOP. In this case ignore means that the default action
is not taken.
http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_sigmask.3.html
http://www.kernel.org/doc/man-pages/online/pages/man2/sigprocmask.2.html
With the default actions listed in signal(7), i.e. term on most defined
signals, or stops the actions defined by the calling thread being inherited.
http://www.kernel.org/doc/man-pages/online/pages/man2/sigprocmask.2.html
--
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100707/a1b5b1bf/attachment.htm>
More information about the zeromq-dev
mailing list