[zeromq-dev] Issue in zGuide
Jacky Wang
jacky.chao.wang at gmail.com
Wed Feb 29 01:05:48 CET 2012
>>> 2) AFAIK, the zmq_socket is not thread-safe thus could not be passed
around. Does ?MQ/2.1 removed this limitation? Otherwise many threads can
easily reuse the same TCP connection...
>
>0MQ socket functions aren't thread safe.
>
>I implemented thread safe socket functions for 0MQ but the
>community didn't seem to want it so I removed it. It was seen
>to encourage sharing sockets between threads rather than
>adding an extra layer of inproc transport.
Hi John,
Thanks for the reply.
It will be great to see the TCP socket sharing between multiple zmq
sockets. And it fulfill my need perfectly (
http://lists.zeromq.org/pipermail/zeromq-dev/2012-February/016223.html).
May I take a look at your socket impl?
Best,
J
On Tue, Feb 28, 2012 at 11:48 AM, Jacky Wang <jacky.chao.wang at gmail.com>wrote:
> Hi there,
>
> I'm reading the ØMQ guide and found an issue in this section:
> http://zguide.zeromq.org/page:all#Programming-with-MQ. It says: "In the
> end, the problem was that the application was passing sockets between
> threads, which crashed weirdly. It became legal behavior in ØMQ/2.1, but
> remains dangerous and something we advise against doing."
>
> However:
>
> 1) In the sample code, only context is passed between threads. The
> sockets are generated separately in each threads.
>
> 2) AFAIK, the zmq_socket is not thread-safe thus could not be passed
> around. Does ØMQ/2.1 removed this limitation? Otherwise many threads
> can easily reuse the same TCP connection...
>
> Comments?
>
> Best,
> Jacky
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120228/4a477f4f/attachment.htm>
More information about the zeromq-dev
mailing list