[concurrency-interest] Improved FJ thread throttling

Doug Lea dl at cs.oswego.edu
Thu Jul 10 12:25:56 EDT 2014


On 07/08/2014 01:39 PM, Doug Lea wrote:
> On 07/08/2014 01:16 PM, √iktor Ҡlang wrote:
>> How about allowing a System Property to set the number of spares, with the
>> default being 256 so one does not have to implement a ThreadFactory to cap
>> it
>
> ... It's a little scary to just attach these considerations to a System
> property, but I'm not otherwise against it.

After sitting on this for a few days, I implemented as
overridable system property with default 256,
(java.util.concurrent.ForkJoinPool.common.maximumSpares)
without any further constraints on value. If people
want to set to ill-advised values, there's no compelling
reason top stop them.

Doing this as an added System property might be slightly
tricky for JDK8 updates: Unless approved otherwise, the
property will exist but the documentation will not
be changed to mention it.

Experience reports on this update would still be very welcome.
We have a bunch of internal tests, but we don't routinely
run any for layered frameworks like Akka and Quasar.


>>
>> The only version available is in our jsr166 main (JDK8/JDK9 only)
>> repository, with the aim of having some of you try it out before
>> considering integration into OpenJDK.  To use it, you can either use the
>> jar at http://gee.cs.oswego.edu/dl/__concurrent/dist/jsr166.jar
>> <http://gee.cs.oswego.edu/dl/concurrent/dist/jsr166.jar> and run with
>> -Xbootclasspath/p:jsr166.jar; or copy into an OpenJDK and build files:
>>
>> http://gee.cs.oswego.edu/cgi-__bin/viewcvs.cgi/jsr166/src/__main/java/util/concurrent/__ForkJoinPool.java?view=log
>>
>>
>>
>> <http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ForkJoinPool.java?view=log>
>>
>>
>>
>> http://gee.cs.oswego.edu/cgi-__bin/viewcvs.cgi/jsr166/src/__main/java/util/concurrent/__ForkJoinTask.java?view=log
>>
>>
>>
>> <http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ForkJoinTask.java?view=log>
>>
>>
>>
>> http://gee.cs.oswego.edu/cgi-__bin/viewcvs.cgi/jsr166/src/__main/java/util/concurrent/__ForkJoinWorkerThread.java?__view=log
>>
>>
>>
>> <http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/ForkJoinWorkerThread.java?view=log>
>>
>>
>>




More information about the Concurrency-interest mailing list