I am using a third-party library to process a large number of data sets. The process very occasionally goes into an infinite loop (or is blocked - don\'t know why and can\'t
One of the ExecutorService.invokeAll(...) methods takes a timeout argument. Create a single Callable that calls the library, and wrap it in a List as an argument to that method. The Future returned indicate how it went.