What happens when a ExecutorService Task...

View: New views
3 Messages — Rating Filter:   Alert me  

What happens when a ExecutorService Task...

by i30817 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Calls interrupt (by shutdownnow or otherwise).
If the executor service caches the Threads does isInterrupted() still
return true in the next task or not?
_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

Re: What happens when a ExecutorService Task...

by Joe Bowbeer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 5:31 PM, Paulo Levi <i30817@...> wrote:
Calls interrupt (by shutdownnow or otherwise).
If the executor service caches the Threads does isInterrupted() still
return true in the next task or not?



There's a long comment about this in the ThreadPoolExecutor source above the private Worker class, and a shorter comment in Worker's runTask method:

Ensure that unless pool is stopping, this thread does not have its interrupt set.

Joe

_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://cs.oswego.edu/mailman/listinfo/concurrency-interest

Re: What happens when a ExecutorService Task...

by i30817 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, cool, all my custom ExecutorServices extend ThreadPoolExecutor.
_______________________________________________
Concurrency-interest mailing list
Concurrency-interest@...
http://cs.oswego.edu/mailman/listinfo/concurrency-interest