[zeromq-dev] zmq_poll: timeout issue
matt_weinstein at yahoo.com
Tue Aug 10 16:07:19 CEST 2010
This is the same problem as pthread condition variables have, e.g.:
Just think of the revents as condition variables to check...
Does someone want to write a quick wrapper ?
PS I recommend CLOCK_MONOTONIC, but it may not be available, and
requires -lrt ...
On Aug 10, 2010, at 9:39 AM, Martin Lucina wrote:
> ilejncs at narod.ru said:
>> I am observing rather strange zmq_poll behavior.
>> It is triggered by timeout and works fine if -1.
> This is a known issue with the current zmq_poll() implementation. The
> zmq_poll(3) documentation mentions this, albeit briefly:
> The zmq_poll() function may return before the timeout period
> expired even if no events have been signaled.
> The solution at the moment is either to use an infinite timeout, or
> the timeout yourself (i.e. call gettimeofday(), recalculate remaining
> timeout and restart the zmq_poll()).
> There is a work in progress branch of the code not ready for public
> consumption yet which will contain a new zmq_poll() implementation
> proper timeout handling.
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
More information about the zeromq-dev