[concurrency-interest] Frequently canceled timers

Joe Bowbeer joe.bowbeer at gmail.com
Thu Jan 24 12:42:23 EST 2008

It should be more efficient to call executor.purge() periodically than
to call remove() frequently.  Will this work in your case?

On Jan 24, 2008 8:20 AM, Richard Johns 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?  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

More information about the Concurrency-interest mailing list