[zeromq-dev] Dropping connection end points dynamically
Radha Krishna Srimanthula
srimanthula.radhakrishna at gmail.com
Thu Apr 19 17:08:36 CEST 2012
Thanks Ian/ Chuck!
I might have to go the mutex way - the connection end points need to be
managed dynamically.
--
Regards,
Radha
On Thu, Apr 19, 2012 at 5:19 AM, Chuck Remes <lists at chuckremes.com> wrote:
> On Apr 18, 2012, at 5:09 PM, Radha Krishna Srimanthula wrote:
>
> > Can you please help me with my first qn?
> >
> > Just to restate - would it be ok to create a socket in a main thread -
> only once, perform subscriptions/ unsubscriptions in another, and perform
> sends on the yet another thread?
>
> Use a mutex to protect the sockets. The main problem is that sockets
> aren't thread safe, so if you make any calls on them simultaneously from
> those 3 threads, bad things will eventually happen. If you use a mutex to
> guarantee that only one thread is accessing a particular socket at a time,
> then you will be safe.
>
> cr
>
> _______________________________________________
> 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/20120419/be21645d/attachment.htm>
More information about the zeromq-dev
mailing list