On occurrence of a specific timeout, I need to kill/cancel/interrupt/fail a running thread. I use ExecutorService to manage a pool of threads, through which I am able to cancel the task using the Future's cancel() method which removes this from the ExecutorService's view, but the thread itself continues to run.
Looking around online, people talk about interrupting threads that have a loop using the isInterrupted() method or are waiting on IO which can be handled by surfacing InterruptedException.
What is the general practice on killing threads that neither loop (or have any other hooks) and are not waiting on IO? Looking around, Thread.stop() seems to do what I need (just blindly kill the thread) but it is not recommended to be used.