[zeromq-dev] preparing bindings for 2.1 release?
sustrik at 250bpm.com
Fri Oct 1 17:40:08 CEST 2010
> Somewhat related: is there a guide to thread safety guarantees of 2.1
> sockets? For example, is it safe to close() the socket from one thread
> if another thread is blocked on recv()/send()? What about poll()? Can
> multiple threads call send() in parallel or they need to be
> synchronized manually?
> These things should probably be documented in the javadocs.
You can migrate a socket from one thread to another. You have to
guarantee the memory barrier when the migration is done.
However, you can never use the same socket from the two threads in
parallel (such as the example you give above).
More information about the zeromq-dev