protected override void OnStart(String[] args)
{
ResultManager.PrepareCache();
ThreadPool.QueueUserWorkItem(ResultQueue.Process);
ThreadPool.QueueUserWorkItem(StatusUpdater.UpdateStatus);
ThreadPool.QueueUserWorkItem(GeneralQueue.RestartHungTests);
ThreadPool.QueueUserWorkItem(ResultManager.SyncroniseResultsTable);
ThreadPool.QueueUserWorkItem(GeneralQueue.RecoverLostResults);
ThreadPool.QueueUserWorkItem(BrowserTestStartInfo.FillQueues);
ThreadPool.QueueUserWorkItem(MailAppAccount.FillQueues);
}
Each of these tasks run for the duration of the life of the Windows Service. I've always stuck to the ThreadPool for this kind of thing, should I be just starting normal threads? Can I be certain the ThreadPool will have enough threads available to run each task? If I SetMaxThreads to 7, will I run into issues later because these threads never abort? Is it safe to set it to something much higher?
Edit:
I always want all 7 threads to be running simultaneously, and they never abort - should I even be using threads? Is there something else more suitable for this kind of perpetually running task?
Each task runs a particular method every x minutes.