Page 1 of 1

About Question enthuware.ocpjp.v7.2.1688 :

Posted: Tue Feb 02, 2016 6:11 pm
by krohani
Paul - I have a question about shutdownNow() method in ExecutorService. The API (and your answer) shows that it returns a list of runnable tasks that were awaiting execution. Here is my question...

1. You can submit both runnables and callables to the executorservice and I don't believe they inherit from each other so what happens to the callables that were awaiting execution when the shutdownNow is called. They don't get returned back in this list, correct?

Re: About Question enthuware.ocpjp.v7.2.1688 :

Posted: Wed Feb 03, 2016 12:32 am
by admin
The API doesn't say anything about that but I believe it is possible for the method to return both by wrapping a Callable into a Runnable. You would have to look into the source code of some concrete ExecutorService to see what it actually does.

HTH,
Paul.