[zeromq-dev] zmq_socket and threads

Joshua Foster jhawk28 at gmail.com
Thu Jan 3 01:43:37 CET 2013


It should be fine if you create a socket to pass to the thread for the 
exclusive access by the thread.

Joshua

> Nishant Mittal <mailto:nmittal at rblt.com>
> Wednesday, January 02, 2013 7:08 PM
> 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..
>
>
>
>
>
>
> -- 
> *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
> Charles Remes <mailto:lists at chuckremes.com>
> Wednesday, January 02, 2013 5:19 PM
>
> This is answered quite thoroughly in the FAQ.
>
> http://www.zeromq.org/area:faq
>
> cr
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> Nishant Mittal <mailto:nmittal at rblt.com>
> Wednesday, January 02, 2013 4:23 PM
> I know that zmq_sockets are not thread safe. however, is it an issue 
> if I ensure a socket is used ONLY by 1 thread at a time?
>
> the reason is ...
> 1) my application creates 5 threads, does some calcs and then the 
> threads exit
> 2) this is done every minute. so every minute 5 new threads are created.
> 3) I think i will run into a file descriptor issue if i create sockets 
> inside the thread (every time the thread is launched). so planning to 
> create 5 sockets when my application starts and then use 1 socket from 
> 1 thread.
>
> is this going to be an issue?
>
> thanks
> Nishant
>
> _______________________________________________
> 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/20130102/0e3c81a4/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/0e3c81a4/attachment.jpg>


More information about the zeromq-dev mailing list