[zeromq-dev] CZMQ zctx_new signal handler side effect
Philip Kovacs
kovacsp3 at comcast.net
Thu Dec 22 20:41:26 CET 2011
* Pieter Hintjens <ph at imatix.com> [2011-12-22 11:40:57 -0600]:
> On Thu, Dec 22, 2011 at 1:30 AM, Philip Kovacs <kovacsp3 at comcast.net> wrote:
>
> > Yeah, but then you create an obligation on the part of the main thread
> > to poll its side of the pipe also....
>
> Yes, exactly. There's no other way to do a clean shutdown. If you're
> happy with a forced shutdown, we could add an API call that grabs back
> signal handling (since it's an exceptional case, I'd rather that was
> extra work, leaving the majority case to work as now).
So, is this technique ok for the attached thread?
Am I correct that, if the attached thread sends no explicit message,
the main thread will not see anything on its zmq_pollitem_t, even if
all masks are set on (ZMQ_POLLIN | ZMQ_POLLOUT | ZMQ_POLLERR) ?
Phil
static void
threadFunc__ (void *args, zctx_t *context, void *pipe)
{
/*
...
*/
if (zloop_start (loop) < 0)
{
zstr_send (pipe, "INTR");
};
zloop_destroy (&loop);
}
-------------- 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/20111222/2cd9b2b3/attachment.sig>
More information about the zeromq-dev
mailing list