[concurrency-interest] Problem in customizing the Executor framework behaviour
a.shahkar at ieee.org
Wed Jul 15 06:11:26 EDT 2009
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