Re: How do I schedule events for execution ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



<pamelafluente@xxxxxxxxx> wrote in message news:1137590881.969877.137220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> As pointed out by Randy, one problem with the sleep approach is related
> to system or program shut down. Assume that I have programmed a thread
> to weak up in 14 hours, 13 minutes, 30 seconds. What about if the
> system is shut down abruptly (for instance by a * power interruption *
> due to a black out ) and then restarted after 5 hours?
>
> Any idea to handle that?
>
> Can we program that a thread should start at a given time instead of
> expressing the duration of the sleep period?
>

A few questions.

1) Are we talking tens or hundreds of tasks?
2) What is the precision of the start times? I would expect it to be minutes, not hours.
3) What is the impact of a scheduled task starting one minute late?
4) Will another task be started before the previous task has completed or do they need to run in sequence.

Based on the answers to the above, I really don't think that the resources used to loop through the task list will be that great.
There is probably no need to fire the timer more frequently than about every 29 seconds. If multiple tasks will run concurrently,
then consider spawning them as separate threads or tasks, otherwise, they can all be executed from the scheduler's thread.

Just my $0.02.

Al Reid


.



Relevant Pages

  • Re: Iterating Functions
    ... previous iterations will be lost. ... Re-Read the table "ORDER BY" the sequence number ... indicates a loop!! ... nested Recordset objects but one Connection object with success. ...
    (microsoft.public.scripting.vbscript)
  • Re: Question about loop
    ... The basic question is can loop be used to write ... Is Common Lisp one of those languages that pretends DELETE is a high ... There has been at least one conforming implementation of Common Lisp ... Sequence may be destroyed and used to construct the result; ...
    (comp.lang.lisp)
  • Re: FizzBuzz
    ... It depends how you do the loop unrolling. ... reason for needing ... On the host we can generate that sequence and look for patterns. ...
    (comp.lang.forth)
  • Re: FizzBuzz
    ... It depends how you do the loop unrolling. ... reason for needing ... On the host we can generate that sequence and look for patterns. ...
    (comp.lang.forth)
  • Re: FizzBuzz
    ... It depends how you do the loop unrolling. ... reason for needing ... On the host we can generate that sequence and look for patterns. ...
    (comp.lang.forth)