[concurrency-interest] Problem in customizing the Executor framework behaviour
joe.bowbeer at gmail.com
Wed Jul 15 07:23:41 EDT 2009
A Shahkar wrote:
> Actually it does not make such difference (specially in performance) if we
> just run 10 threads instead of a pool, each one executing BlindTaskRequest.
> Am I right?
Yes, based on my understanding of your description, I think you are right,
and that's the approach I'd recommend.
On Wed, Jul 15, 2009 at 3:11 AM, A Shahkar wrote:
> Thanks Erkin.
> I was told to take a similar approach when I posted the problem in Sun
> forums. IMHO, it has a few drawbacks.
> Let's suppose N=1,000. We create a fixed thread pool with the size of 10,
> and instantiate BlindRequest to send 100 requests. We submit the
> BlindRequestTask 10 times to the thread pool. Now, for any reason, sending
> the forth request in the second thread takes a long time. Other threads
> likely finish their work far before the second thread does while it still
> has a few ten requests to send. Other threads won't help the second one
> finish its job, and that's not the way thread pool executors are intended to
> act it. Actually it does not make such difference (specially in performance)
> if we just run 10 threads instead of a pool, each one executing
> BlindTaskRequest. Am I right?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest