[zeromq-dev] Thread Safe sockets

john skaller skaller at users.sourceforge.net
Tue Feb 7 02:15:22 CET 2012

On 07/02/2012, at 11:37 AM, Joshua Foster wrote:

>  If we do this, I would rather see completely new sockets 
> like ZMQ_PUB_CONCURRENT instead of modifying the existing ones.

That is another possible API. Though the way to do it is probably just to add
a socket option ZMQ_THREAD_SAFE so all the existing socket types had
a thread safe variant. Alternatively

	ctx.thread_safe_socket (ZMQ_PUB)

would do the same thing. The "per socket" thread safety has the advantage of
providing more fine grained control. But that's also a disadvantage (lack
of enforcement requires more code review).

In all these cases the safety is fully upwards compatible. The changes provide
new features, nothing old breaks.

john skaller
skaller at users.sourceforge.net

More information about the zeromq-dev mailing list