[zeromq-dev] Exiting blocking calls on shutdown

Martin Sustrik sustrik at 250bpm.com
Sun Apr 11 16:42:16 CEST 2010

Hi all,

The problem of threads remaining is blocking calls on application 
shutdown used to make closing 0MQ application problematic.

The patch currently committed to the trunk solves the problem in the 
following way:

When context is closed (zmq_term), all threads that are currently 
blocked in blocking calls - such as zmq_recv - will exit immediately 
with ETERM error.

Any subsequent attempts to use sockets will produce ETERM error.

In this situation the user should close the socket, otherwise memory 
leak will result.


More information about the zeromq-dev mailing list