[zeromq-dev] zloop timers

Chuck Remes cremes.devlist at mac.com
Tue May 24 20:37:56 CEST 2011

On May 24, 2011, at 10:32 AM, Kim Lester wrote:

> Comment:
> If we insert the timers into the timer list in order of delay then
> a) we move calculations outside core zloop
> a) we don't need to iterate over list looking for shortest delay, just take first item (note second timer equal first I suppose but we can test that when the first expires)
> b) save on calculating "when" for all bar first item in list.
> Have I missed anything ?

I do something very similar for my zmqmachine project. All timers are inserted into a list in the order they should fire.

The one issue I have encountered with this concerns multiple timers that have the exact same firing time. They will be in order but if you need to delete one of them then you need additional information attached to the timer to pick out the correct one.


More information about the zeromq-dev mailing list