[zeromq-dev] Perennial thread safety question
Michael Powell
mwpowellhtx at gmail.com
Mon Apr 8 12:40:34 CEST 2013
Hello,
I am still evaluating ZMQ as a potentially viable infrastructure for our
ecosystem messaging concerns. And now it seems threading is the topic of
the day, or rather the lack of thread-safety. This is partly ignorance on
the subject on my part, so correct me if I am wrong, or the paradigm seems
foreign as ZMQ was intended for use.
I read that ZMQ Context is king. From what I can tell Context is
thread-safe. You can allocate new sockets and connect all day long on the
same context from different threads and you're fine, right as rain?
Context, context, context: context is king.
Sockets themselves are not thread-safe. I'll hazard to guess allocating and
using sockets in a thread is a "trivial" matter. They are intended as
disposable objects.
I am interested to design a pub/sub event brokering type system potentially
exposing ZMQ-based messaging throughout our ecosystem, inproc or IPC. If I
do that I need for my ZMQ adapters to handle context in a thread-safe
manner? Making the assumption publishers and subscribers maintain their own
sockets, etc.
Regards,
Michael Powell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130408/9e5b3638/attachment.htm>
More information about the zeromq-dev
mailing list