[concurrency-interest] Frequently canceled timers
szabolcs.ferenczi at gmail.com
Fri Jan 25 10:09:11 EST 2008
On 24/01/2008, Richard Johns <rjohns at nortel.com> wrote:
> I have an application that retransmits messages when they don't get a
> timely response . Usually, of course, that's not necessary and their
> timers are canceled. This is a traffic generator so message rate is
> high and we need to remove the canceled timers.
> Is there a timer implementation that efficiently cleans up canceled
How about re-using the timer instead of throwing it away?
Reset it and use it again.
DelayQueue uses a binary heap so it's very fast otherwise, but
> it uses a sequential search for remove(). ScheduledThreadPoolExecutor
> uses DelayQueue, and Timer also uses a binary heap.
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest