[zeromq-dev] Strange problem with lua-zmq on Windows

Pieter Hintjens ph at imatix.com
Wed Aug 10 23:22:06 CEST 2011


On Wed, Aug 10, 2011 at 7:18 PM, Chuck Remes <cremes.devlist at mac.com> wrote:

> BTW, you *can* share 0mq sockets amongst threads as long as only 1 thread is using a socket at any given time. So, for example, you could have a socket pool where each thread "checks out" a socket from the pool, uses it, and then checks it back in again.

So technically this is accurate under one condition: each thread must
do a full memory barrier as it switches sockets between threads.

People systematically get this wrong, and thus the Guide boils it down
to "don't".

-Pieter



More information about the zeromq-dev mailing list