RFR: JDK-8277175 : Add a parallel multiply method to BigInteger

Joe Darcy darcy at openjdk.java.net
Tue Nov 16 20:02:36 UTC 2021


On Tue, 16 Nov 2021 18:52:20 GMT, kabutz <duke at openjdk.java.net> wrote:

> 
> 
> > It isn't clear to me that parallelMultiply should be a public method as opposed to an implementation detail.
> 
> Hi Joe, thanks for responding. I would have preferred for it to be an implementation detail, but I thought it best to keep things consistent with other parts of the JDK. For example:
> 
>     * Arrays#sort() vs Arrays#parallelSort()
> 
>     * Collection#stream() vs Collection#parallelStream()
> 
> 
> One could do it as an implementation detail, with a special flag to turn off the functionality. But that would mean that the parallelMultiply() would be on for all multiplications in a system. I would expect that some organizations would for whatever reason not want to use more cores than absolutely necessary?

Hi Heinz,

As you cite, there are a few other cases in the JDK API were a second "parallelFoo" method is exposed. However, I don't think those precedents would necessarily mandate a parallelMultiply method in BigInteger. Without a separate method, there is a question of tuning of course.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6409


More information about the core-libs-dev mailing list