I have a windows service which executes a job asynchronously every few minutes, sometimes the windows service executes and the previous job has not finished, using threading is there a way to queue the new job if the previous one hasnt finished so that it starts running when the first job finishes?
I have a windows service which executes a job asynchronously every few minutes, sometimes
Share
You could create your own producer/consumer queue of jobs – effectively a single-thread threadpool.
This is easy to do in .NET 4 using
BlockingCollection<T>; before then it’s a little trickier, but not too bad.