[zeromq-dev] Question about context and/or socket creation

James Chapman james at linux-101.org
Fri Sep 30 12:49:02 CEST 2016


Thanks, I'll move to a shared context that persists for the duration of the
process.

​Sockets are one per thread, in fact, as the threads are re-used, each
thread will create many sockets over its lifetime.​

-​James​



On 30 September 2016 at 11:24, Luca Boccassi <luca.boccassi at gmail.com>
wrote:

> You can (and probably should as best practise) reuse the context,
> which is thread safe.
>
> Do not use the same socket from multiple threads. There is a new
> category of thread-safe sockets in libzmq master but the API is not
> yet finalised.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160930/be42e9fd/attachment.htm>


More information about the zeromq-dev mailing list