[concurrency-interest] missed deadlines.

Peter Veentjer alarmnummer at gmail.com
Thu Jul 6 15:51:51 EDT 2006

> I understand your main point is that the scheduled executor doesn't
> automatically create threads in order to satisfy/meet the schedule,
> and I have nothing to offer :-)
Uncontroller thread creation is a bad thing.

I wonder how one should deal with missed deadlines. I'm writing an
article about different timer implementations and how they are
integrated in Spring. One of the things that crossed my mind where the
missed deadlines and how they should be/could be solved.

> For dropping tasks when the deadline has been missed, I want to point
> out that there are helper methods to help tasks decide that.
> TimerTask has scheduledExecutionTime
>    public void run() {
>        if (System.currentTimeMillis() - scheduledExecutionTime() >=
>            MAX_TARDINESS)
>                return;  // Too late; skip this execution.
>        // Perform the task
>    }
> And ScheduledFuture has getDelay.  (But, on closer inspection, I think
> it may be tricky for a scheduled runnable or callable "task" to call
> this method, since a ScheduledFuture is created for the task by the
> ScheduledExecutorService when the task is submitted.)

I'll have a look at them. Thanks for the reply.
> --Joe
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest

More information about the Concurrency-interest mailing list