[concurrency-interest] javadoc upgrade for threadpoolexecutor.shutdown/shutdownnow

Joe Bowbeer joe.bowbeer at gmail.com
Wed Jul 19 16:05:29 EDT 2006


On 7/19/06, Peter Veentjer <alarmnummer at gmail.com> wrote:
> I had a nice discussion with a colleague of mine about the
> ThreadPoolExecutor and the shutdown/shutdownNow methods.
>
> It wasn't clear that the shutdown method doesn't block but only
> signals that the ThreadPoolExecutor  is going to shut down.
>
> The shutdownNow method does block (untill all running tasks have
> processed) and this wasn't very intuitive also.
>
> So can the documentation be upgrades so they explain the blocking
> behaviour of both methods?
>

shutdownNow doesn't block either (and doesn't throw InterruptedException).

awaitTermination blocks (and throws InterruptedException).

We've just updated javadoc in ExecutorService, explaining what
shutdownNow does and adding a shutdownAndAwaitTermination example.

http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ExecutorService.java

Is this sufficient, or should we add a link back to this in ThreadPoolExecutor?

--Joe


More information about the Concurrency-interest mailing list