Suppose I have a thread pool with 10 threads. Let's say that one of the threads in the pool executes some task. I want that in certain cases, the task will stop its execution, the thread will take another task and only later it will return to the previous task and continue it from where it stopped.
Is this possible? How can I do it?