Executors enhancement

Claes Redestad claes.redestad at oracle.com
Sun Aug 7 23:16:21 UTC 2016


Hi Christian,

have you looked at java.util.concurrent.ForkJoinPool.commonPool()?

/Claes

On 2016-08-08 00:51, Christian Schulte wrote:
> Hello,
>
> whenever I need to update an existing codebase to add some kind of
> parallelization, I am in the need of an executor matching the number of
> processors available at runtime. Most of the time I end up using
> something like:
>
> 'Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())'
>
> If every library used by an application needs to maintain its' own
> executors the application ends up with starting number of libraries used
> times number of available processors threads. That does not scale. I
> think there really is a need for some kind of default executor provided
> by the platform. I am suprised I cannot find anything like that
> anywhere. I would like to request an enhancement providing such a
> default platform executor everyone can use to add parallelization
> without ending up with tons of threads when all you want is making use
> of the system's parallelization capabilities.
>
> Regards,
>


More information about the core-libs-dev mailing list