[concurrency-interest] Some fork/join threads idle when workload is non-uniform

Doug Lea dl at cs.oswego.edu
Sat May 26 08:01:32 EDT 2012


On 05/26/12 04:55, Peter De Maeyer wrote:
> We have a multithreaded application which relies heavily on the F/J framework.
> When threadprofiling the application we've observed that not all F/J threads are
> kept busy. Some threads spend a lot of time waiting, thus making suboptimal use
> of the available CPUs in the system.

As far as I can tell by running your example code, the underlying issues
have been addressed for upcoming jdk8 version, as well as in the
standalone jsr166y version that you can use/run now by grabbing
jar file and changing imports from "java.util.concurrent" to "jsr166y".
(See http://gee.cs.oswego.edu/dl/concurrency-interest/index.html)
Please try this and let me know if not.

The main underlying issue is that thread compensation was overly
conservative, which avoided unbounded spare thread construction
in the worst cases of misuse, but at the expense of overly limiting
parallelism in other cases.

-Doug



More information about the Concurrency-interest mailing list