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?
About Question enthuware.ocpjp.v7.2.1688 :
Moderator: admin
-
- Posts: 31
- Joined: Tue Oct 06, 2015 1:57 pm
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1688 :
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.
HTH,
Paul.
Who is online
Users browsing this forum: No registered users and 4 guests