[zeromq-dev] Thread Safe sockets

Martin Lucina martin at lucina.net
Tue Feb 7 01:58:29 CET 2012


On Mon, 06 Feb 2012 19:37:28 -0500
Joshua Foster <jhawk28 at gmail.com> wrote:

> I'm not sure if other languages have the same mechanism, but Java has a 
> ThreadLocal object. It allows the developer to create and store objects 
> local for each thread. In the ZMQ case, it would be an inproc socket for 
> each thread so that we can hide the complexity of thread safety under 
> the covers. If we do this, I would rather see completely new sockets 
> like ZMQ_PUB_CONCURRENT instead of modifying the existing ones.

I don't follow. Making an object "thread local" as I understand it is
making a single identifier/symbol/name X refer to multiple instances of
something. How does that need a new socket type?

Maybe Java ThreadLocal means something else? I don't do much Java...

-mato
-- 
Martin Lucina <martin at lucina.net>



More information about the zeromq-dev mailing list