Why one can't submit an alternative thread pool to the streams API?

Brian Goetz brian.goetz at oracle.com
Sat Oct 26 12:45:40 UTC 2019

> If you don't want people to use anything other than the common pool, then you should at least add a provision to the API to set the level of parallelism for a given stream, e.g. `.parallel(2)`.

Agree that it is desirable to be able to limit the level of parallelism, but that’s not the right API either.  (If it were as easy as that, we would have done it already.)  

(This is exactly what I meant by my earlier comment about the real estate between “parallel(“ and “)” — everyone wants to build there, and everyone thinks they know what goes there, but so far, none of the ideas proposed are very satisfying.)

More information about the jdk-dev mailing list