G
Guest
Anyone know of a reliable design for a Windows C++ Task Scheduler
Class.
The scheduler will expose a member function that will add schedules,
its parameters will be an interval to run the tasks and a function
pointer. This function pointer will be a void* function in other
objects that will use the scheduler.
So when another object calls the addSchedule function the scheduler
will run these tasks at each interval provided. There may be a number
of tasks running at the same time.
Should I design this as single or multi threaded, it seems I need to
make it multi threaded as I may have to use a waitable timer? But would
prefer the debugging ease of a single threaded design.
Should I make the scheduler a singleon?
There is an example quite similar at:
http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5783/
But this example does not work in a Windows Service and when I use a
waitable timer I have to make it multithreaded.
So any ideas\pointers\links for me on a good base design for this
class.
Enda
Class.
The scheduler will expose a member function that will add schedules,
its parameters will be an interval to run the tasks and a function
pointer. This function pointer will be a void* function in other
objects that will use the scheduler.
So when another object calls the addSchedule function the scheduler
will run these tasks at each interval provided. There may be a number
of tasks running at the same time.
Should I design this as single or multi threaded, it seems I need to
make it multi threaded as I may have to use a waitable timer? But would
prefer the debugging ease of a single threaded design.
Should I make the scheduler a singleon?
There is an example quite similar at:
http://www.codeguru.com/Cpp/W-P/system/misc/article.php/c5783/
But this example does not work in a Windows Service and when I use a
waitable timer I have to make it multithreaded.
So any ideas\pointers\links for me on a good base design for this
class.
Enda