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

Osiris Pedroso opedroso at gmail.com
Tue Oct 4 21:34:10 CEST 2016


I tried to compile, but I don't have the zmq.hpp file it includes.
What github project to I need to get it?

On Tue, Oct 4, 2016 at 11:36 AM James Chapman <james at linux-101.org> wrote:

> I suspect there is a bug within ZMQ, that or I'm doing something stupid.
> Actually, the latter is probably more likely as I'd like to think that this
> would have surfaced elsewhere if it was a bug. Attached is minimal test
> program which reproduces the issue on my system. In my test, ZMQ is
> statically linked to the test program. This is a Windows program compiled
> in Visual Studio 2015. Once running, after roughly 2 mins 40 seconds it
> crashes. There's an error message that says "abort() has been called".
>
> Could someone please confirm that they also see the crash, and if I am
> doing something stupid please feel free to tell me.
>
> James
>
>
>
>
>
> On 30 September 2016 at 11:49, James Chapman <james at linux-101.org> wrote:
>
> 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.
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20161004/b09222d3/attachment.htm>


More information about the zeromq-dev mailing list