[zeromq-dev] [PATCH] Scalability improvements for large amounts of connections

Martin Lucina mato at kotelna.sk
Mon Oct 11 22:34:01 CEST 2010


matt_weinstein at yahoo.com said:
> Would implementing something like :
> 
> zmq_setsockopt(...ZMQ_MIGRATE...) // makes this socket MINE
> 
> be more useful?
> 
> The memory barrier would be called inside the setsockopt() call,  
> reducing the black magic required of the user.
> 
> As a bonus you could store the owner's thread id in the socket, and  
> return an error if the wrong thread tries to use the socket  
> thereafter ... (EHANDSOFF ? :-) )

I like this idea -- the problem with fuzzily talking about migrating
sockets between threads using memory barriers is that someone, somewhere,
will try this and get it wrong, and complain.

If we provide an explicit interface to migrate sockets then we can say
"just use that". Users who understand memory barriers can still do that if
they want to.

Martin, what do you think?

-mato



More information about the zeromq-dev mailing list