[zeromq-dev] Multiple threads calling zmq_send on a PUSH queue..
Arvind N
Arvind.N at citrix.com
Thu May 12 13:09:02 CEST 2011
Hi,
Will there be any issue if I have say 3 threads pushing data into a PUSHQ using the global shared variable zmq_sock being used across threads without using any MUTEX in using C ZMQ library....... sample shown below...
PUSHQ inited globally.. like below and zmq_sock is accessible across therads...
void* context = zmq_init (1);
void *zmq_sock = zmq_socket (context, ZMQ_PUSH);
zmq_bind (zmq_sock, "ipc://...");
Each thread doing the below stuff using shared zmq_sock pointer ??
char *data .....;
zmq_msg_t message;
zmq_msg_init_size(&message, size);
memcpy(zmq_msg_data(&message), data, size);
int rc = zmq_send(zmq_sock, &message, 0);
thanks
Arvind
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110512/644c98fe/attachment.htm>
More information about the zeromq-dev
mailing list