[zeromq-dev] adding timeout in zmq_poll

Pavel Gushcha pavimus at gmail.com
Mon Dec 28 11:22:57 CET 2009


2009/12/28 Steven McCoy <steven.mccoy at miru.hk>

> 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
>> stones:
>>
>> 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
> improvement.
>
> 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.
>

I'm tallking about internals zmq_poll(). Now each call to zmq_poll()
analyzes whole pollitems array, event if it is not changed. wich many
sockets (>1..10k) this may eat some CPU. or this overhead is not noticeable?


>
> --
> Steve-o
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20091228/dddebc0e/attachment.htm>


More information about the zeromq-dev mailing list