[concurrency-interest] Questions about ThreadPoolExecutor

Kwok, Grace (MSCIBARRA) Grace.Kwok at mscibarra.com
Wed Mar 1 21:24:57 EST 2006


Thank you all for the valuable suggestions.

Do you mind explain this further?
"This could be done by having all of the dedicated executors submit
their work to one master executor."

 

Thanks, Grace


-----Original Message-----
From: Joe Bowbeer [mailto:joe.bowbeer at gmail.com] 
Sent: Wednesday, March 01, 2006 5:17 PM
To: Kwok, Grace (MSCIBARRA)
Cc: Brian Goetz; concurrency-interest at cs.oswego.edu
Subject: Re: [concurrency-interest] Questions about ThreadPoolExecutor

On 3/1/06, Kwok, Grace (MSCIBARRA) <Grace.Kwok at mscibarra.com> wrote:
> "You can create a custom Executor for each batch of Callables.  You 
> will probably want to use some other bounding mechanism to ensure that

> aggregate number of threads created by such executors doesn't exceed 
> some threshold."
>

This could be done by having all of the dedicated executors submit their
work to one master executor.


> If I am to create an Executor for each batch of Callables, the threads

> from Executor 1 could not be reused by threads from Executor 2, is 
> that correct?  Is this optimal?  Is this like a pool of Executors?
>

ThreadPoolExecutor per batch seems right to me.  If you want to cleanup
when a batch is done, you can call executorService.shutdown().

You can also call executorService.setKeepAliveTime() so that the idle
threads will self-terminate more or less automatically.
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.



More information about the Concurrency-interest mailing list