We have a .ForEach loop (TPL) which starts many, many, many Tasks.
Since the TPL is consuming threads from the thread pool I am wondering what will happen when there are no more threads available?
Will the calling code block until threads are available again?
I know the threadpool has a global work queue where work items (Task) will be queued. Can that queue ever be full?
Our problem is that some of the tasks are long running (30 minutes) and some are short (a second), but we have thousands of such Tasks, if not more. Does the TPL start a new Thread for each Task I start? I think not. At what point will the thread pool be exhausted?