[zeromq-dev] adding timeout in zmq_poll
steven.mccoy at miru.hk
Mon Dec 28 09:32:33 CET 2009
2009/12/28 Pavel Gushcha <pavimus at gmail.com>
> I want to have timeout parameter in zmq_poll function. As i understood, It
> is not very difficult to implement this. But i want to ask about underwater
> 1) All oses support timeout parameter? in zmq.cpp i see one part of code
> for windows, and one for other oses. Both parts have timeout parameter, but
> for windows we can set timeout with microsecond granularity. We can't get
> such granularity in linux?
Linux generally has had 4ms resolution timers, Windows with 16ms, Linux has
improved with high resolution timers, pre-emptive kernel, real-time, etc,
but neither are overly accurate or useful at sub-millisecond timing across
all functions, select() being pretty poor on Linux.
ZMQ on Windows also still only uses select(), Vista & 7 offer a poll()
function although it might just be an emulated interface with no performance
Unfortunately even though some functions offer microsecond to nanosecond
parameters neither the underlying software or hardware stack support it.
> 2) With adding timeout parameter in zmq_poll i must update bindings. I
> looked at them and found, that binding for zmq_poll present only in
> C,C++,Common Lisp bindings. May be i miss something?
> As i see, now zmq_poll is not optimized for polling big amount of sockets.
> Is there plans to optimize this?
With the existence of epoll.cpp I would guess there are some plans.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zeromq-dev