If all currently running tasks are blocked, what will happen? Is there a way to take a task from this queue and queue a locked task?
No, there are no funds for this. If the task starts and is blocked, it will block this thread until it finishes normally or is interrupted by the completion of the thread pool.
How do we know if a task is blocked or completed?
If you need to know this, you need to introduce some knowledge into the task code, which can then be requested by another part of your application. Obviously, something else will need to keep a link to the task for this to work before sending it to the performer.
source share