scheduling

D

daveL

Hello,
I have created a Class that creates Schedules
daily, ,interval (seconds), monthly, etc

this class only holds next run time, updates to nextrun time after and so
forth...just holds holds information about a single schedule and methods to
preform maintenance...

lets say i have a list of 100 of the above schedules to execute some event
based on daily, seconds, weekly, etc
there stored in a Collection
what would be the best way to impliment this in a windows service
1 . single timer in the service set to say 10ms to scan the collection and
see if current time is time to kick off event
or
2. set a timer for each indivual schedule and let the service just maintain
the list of schedules

hope i explained that enough
tks
DaveL
 
C

Ciaran O''Donnell

Have you looked at the Windows Task Scheduler? I have seen so many people
making windows services which have all sorts of logic about running things
every X days/minutes etc. The put in clever configuration so they can chop
and change what gets run, even put in things to run as other users.
Then I show them around the task scheduler and they realise that Microsoft
already wrote all that code, tested it, and released it for free as part of
the OS.
I have seen fare less people who needed to write their own solution then
people who should have used Scheduler.

Check it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

C# Threads 6
Threads problem 1
Why no cross-threading problems with DispatcherTimer? 2
Timers and code... 1
Scheduling 1
Creating a Hi-Res Timer 10
Threading issues and question 4
scheduling 3

Top