[zeromq-dev] zmq_socket and threads

Nishant Mittal nmittal at rblt.com
Thu Jan 3 01:08:25 CET 2013


Joshua, if you read my first msg in this thread you'll see that its
guaranteed by application logic.. 5 threads at a time.. 5 different
sockets.. each thread only uses its own socket... the only issue i wanted
to check was that the sockets were not created "by the thread" thats going
to use them .. which the guide discourages..



On Wed, Jan 2, 2013 at 7:03 PM, Joshua Foster <jhawk28 at gmail.com> wrote:

> The mutex is "required" because it guarantees that it is only used by a
> single thread at a time. ZMQ has assertions that will cause your
> application to crash if you access a socket between two threads
> concurrently.
>
> Joshua
>
>   Nishant Mittal <nmittal at rblt.com>
>  January 2, 2013 6:58 PM
> Charles.. the most relevant (to my use case) piece there is.. "For those
> situations where a dedicated socket per thread is infeasible, a socket may
> be shared *if and only if* each thread executes a full memory barrier
> before accessing the socket. Most languages support a Mutex or Spinlock
> which will execute the full memory barrier on your behalf."
>
> However, I was wondering that given my app logic below, do I need to use
> mutex etc?.. each thread is completely independent of the other.. no shared
> objects.
>
> thanks
> NIshant
>
>
>
>
>
>
> --
> *Nishant Mittal*
> Director, Product Development
> *Rosenblatt Securities Inc*.
> 20 Broad Street
> New York, NY 10005
>
> Direct: 212-607-3159
> Mobile: 646-504-2629
>  _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>


-- 
*Nishant Mittal*
Director, Product Development
*Rosenblatt Securities Inc*.
20 Broad Street
New York, NY 10005

Direct: 212-607-3159
Mobile: 646-504-2629
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130102/225084eb/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compose-unknown-contact.jpg
Type: image/jpeg
Size: 770 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130102/225084eb/attachment.jpg>


More information about the zeromq-dev mailing list