[zeromq-dev] zmq::poll timeout returns immediately on MacOS/X 10.5

Steven McCoy steven.mccoy at miru.hk
Fri Jun 11 07:29:34 CEST 2010


On 11 June 2010 13:16, Martin Sustrik <sustrik at 250bpm.com> wrote:

> Let me explain the problem: To do exact timouts, zmq_poll would have to
> measure exact time (gettimeofday) at the beginning of the function. If
> it doesn't know the time it was invoked, it cannot terminate at right time.
>
> This time measurement is the impact I am speaking of. Although it may
> seem negligible, in a tight loop it can decrease overall throughput (I'm
> guessing here) by ~30%.
>
> One way to solve the problem would be to use some fast mechanism (such
> as rdtsc on x86/64) to find out whether noticeable time has elapsed
> since last call to zmq_poll (say at least 1ms), call gettimeofday only
> if it did, and use the previous time measurement if it didn't.
>
> Of course, this would leave non-x86 platforms with the full performance
> impact.


 With Nehalem you should be using gettimeofday() as it's now using rdtscp
which apparently solves world hunger according the LKML.  On SPARC, RS6000,
PA-RISC gettimeofday() is already light so the only issue would appear to be
older x86 platforms and possibly the embedded range which performance is
kind of moot anyway.

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100611/f80ae0d3/attachment.html>


More information about the zeromq-dev mailing list