[zeromq-dev] Assertion failure in mailbox.cpp

Jon Gjengset jon at thesquareplanet.com
Mon May 19 15:51:38 CEST 2014

> > In the rbczmq gem, I decided to put a mutex around any calls to close
> > a socket so only one could happen at a time. This incurs a performance
> > hit for applications opening and closing many sockets - but I
> > understand that is not a recommended usage pattern.
> If there is a race condition between the closing of different sockets
> belonging to the same context, then this should be documented, and
> potentially fixed. While I could add a mutex around the closing as you
> say, I'd really rather not; part of the reason I wanted to move to ØMQ
> in the first place was to get rid of unnecessary locks.

I tried adding a mutex around every call to zmq_close now, and the
assertion still fails, so it seems like this is not a close-close race.
Since the assertion fail happens in a recv call, it looks more like a
close-recv problem?

More information about the zeromq-dev mailing list