Note that I'm not talking about any specific implementation in any specific language.
Lets say I have a thread pool and a task queue. When a thread runs it pops a task from the task queue and handles it - that thread might add additional tasks into the task queue, as a result. The time the thread has to handle a certain task is unlimited - meaning the thread works until the task is finished and never terminates before that.
What kind of problems (e.g. deadlocks) each the following thread pool configurations are susceptible to?
Possible thread pool configurations I'm concerned with:
1) Unbounded task queue with bounded num. of threads
2) Bounded task queue with unbounded num. of threads
3) Bounded task queue with bounded num. of threads.
4) Unbounded task queue with unbounded num. of threads
Also - say that now the thread has a limited time to handle each task, and is forcibly terminated if it doesn't finish the task in the time frame that was given. How does that change things?