[zeromq-dev] Integrating ZeroMQ sockets in a existing WaitForMultipleObjects pool

Felipe Farinon felipe.farinon at powersyslab.com
Thu Mar 21 21:20:15 CET 2013


Hi,

I have a WaitForMultipleObjects pooling mechanisms that waits for 
several things (for example, the handle of the process that has spawned 
my process). I wish I could be able to integrate a ZeroMQ socket in that 
pool.
So, I created the following code: http://pastebin.com/M5jxWUGe. But I 
was wondering:

1) 'dataSocket' has many messages arriving per second. If I put another 
socket in this WaitForMultipleObjects poll, 'dataSocket' can starve the 
new socket right? Is there a good workaround for this?
2) Is passing FD_ALL_EVENTS to ::WSAEventSelect the right way to do it? 
I have tried using only FD_READ and it seemed that i didn't get all the 
messages that were sent.
2) The do/while inside the event signaling handler is a consequence of 
ZMQ_FD being edge-triggered instead of level-triggered. But I saw the 
implementation of zmq_poll and it uses the same ZMQ_FD file descriptor, 
but guarantees that it's behaviour is level-triggered. How it could be 
achieved, seeing that it is the same ZMQ_FD being used?

Thank you!



More information about the zeromq-dev mailing list