[zeromq-dev] zmq_term() blocks in 2.1

chris csrl at gmx.com
Thu Jan 13 04:40:51 CET 2011


David Kantowitz <dkantowitz <at> gmail.com> writes:
> Thanks for pointing me back to the older discussions.  I read through some of 
> emails and I think what I want is somewhat simpler then the issues discussed. 
> I don't care if messages are fully flushed at the time zmq_term() returns, I 
> just don't want zmq_term() to hang my main thread.

Not strictly relevant to this thread, but FYI, the erlang bindings 
implementation at http://github.com/csrl/erlzmq supports this non-blocking 
behavior.  If any sockets are still open in the context, the zmq_term() wrapper 
returns EAGAIN and all sockets return ETERM.

It was necessary to implement this in the erlang bindings, as blocking calls 
can not be allowed in erlang port drivers, as that would cause the erlang vm to 
freeze.

It works well, and would be great if the concept makes it into the main 0MQ 
implementation.

chris




More information about the zeromq-dev mailing list