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

Brian Goetz brian.goetz at oracle.com
Sat Oct 12 17:03:06 UTC 2019


> It certainly isn't elegant. Perhaps a better way might be an argument to the parallel method that specifies the pool to be used?

This was discussed early during the development of the streams API, and quickly went into the bucket labeled “obvious but wrong.”  (It’s in good company.)  For every case where this is the right move, there are 10,000 others where it will be an attractive nuisance, but wrong.  It wouldn’t be fair to Java developers to dangle this option in their face.  

Further, while everyone agrees the real estate between `.parallel(` and `)` is the right place to “build” to provide more control over parallel execution, no one agrees what we should actually build there.  Pretty convinced that a FJP is the wrong thing to build there, but still not sure what the right thing is, so we leave it undeveloped for now.


More information about the jdk-dev mailing list