[zeromq-dev] non-blocking shutdown command
Matt Connolly
matt.connolly at me.com
Wed Sep 11 00:24:18 CEST 2013
Couldn’t this be already solved by having the main thread simply close the socket?
Sockets are supposed to be only used on a single thread, but I understood the zmq_term would close the sockets anyway. The result would be that calls to send or receive on the socket would return an error code.
Alternately, I thought you could use a PAIR socket to send a message from the main thread to the working thread and use that to signal the working thread to close the other socket and end processing. (i.e.: poll on both sockets).
I guess it depends if you want this thread shutdown to only happen once and finish everything, or if other parts of your app need to keep working.
-Matt
On 11 Sep 2013, at 12:31 am, Richard_Newton at waters.com wrote:
> Hi All,
>
> I've just implemented a non-blocking shutdown command name zmq_ctx_shutdown and am concerned about the name. This is an optional command that can be used when you want to shut down a context that will unblock any blocked operations on other threads but will not then block waiting for all sockets to be closed.
>
> More details are in the pull request here: https://github.com/zeromq/libzmq/pull/650.
>
> So do people have any comments on the name?
>
> Ric.
>
>
>
>
>
> ===========================================================
> The information in this email is confidential, and is intended solely for the addressee(s).
> Access to this email by anyone else is unauthorized and therefore prohibited. If you are
> not the intended recipient you are notified that disclosing, copying, distributing or taking
> any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
> ===========================================================
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130911/612607ad/attachment.htm>
More information about the zeromq-dev
mailing list