[concurrency-interest] Frequently canceled timers

Szabolcs Ferenczi 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
> timers?


How about re-using the timer instead of throwing it away?
Reset it and use it again.
Best Regards,
Szabolcs

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.
>
> --
> Rick
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20080125/5ca6909b/attachment.html 


More information about the Concurrency-interest mailing list