I have a number of tasks inside a
You cannot safely kill threads immediately. You tasks should instead honour interrupts and stop when interrupted. If you use
ThreadPoolExecutor.shutdownNow(), all the running tasks will be interrupted.
The only alternative is to the threads in a separate process is issue a signal to kill the process.