[zeromq-dev] missing events ZMQ_FD / ZMQ_EVENTS

Paul Colomiets paul at colomiets.name
Wed May 2 12:27:42 CEST 2012

Hi Gerhard,

On Wed, May 2, 2012 at 12:45 PM, Gerhard Lipp <gelipp at googlemail.com> wrote:
> I really appreciate any help and ideas to solve this issue! I just did
> not get the idea behind this attempt.
> Could you explain it in more detail (something particular to observe)?

Ok. Behind the scenes ZMQ_FD, is basically a counter, which wakes up
poll when is non-zero. The counter is reset on each getsockopt ZMQ_EVENTS,
zmq_send and zmq_recv.

The following diagram shows race condition with two sockets A and B,
in a scenario similar to yours:


Note: the last poll is entered with both counters set to zero, so it
will not wake up, despite the fact that there is pending message.


More information about the zeromq-dev mailing list