Best technique to Schedule Tasks
-
Now a days i am working on a software , which will run specific scheduled tasks at certain time.What should be the technique to develop this software. One obviouse way is using Timers , but is there some built in notifications by windows.which could infrom my application at certain time. My schedule may be like this Task1 12:30:30 PM 7July 2004 Task2 2:30:30 PM 7July 2004 Task3 1:30:30 AM 8July 2004 Task4 12:30:30 PM 8July 2004 etc. Unmanaged in a .NET world
-
Now a days i am working on a software , which will run specific scheduled tasks at certain time.What should be the technique to develop this software. One obviouse way is using Timers , but is there some built in notifications by windows.which could infrom my application at certain time. My schedule may be like this Task1 12:30:30 PM 7July 2004 Task2 2:30:30 PM 7July 2004 Task3 1:30:30 AM 8July 2004 Task4 12:30:30 PM 8July 2004 etc. Unmanaged in a .NET world
If you want your process to do the work, use CreateWaitableTimer. This will allow you to put your process into an efficient sleep, to be awoken at the appropriate time (or other circumstances, like a Windows Shutdown...). Otherwise, submit the tasks to the internal Windows Task Scheduler, which is capable of performing various types of 'jobs'.