Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Controlling parallelism in nested parallel collection #10577
I have really hard time understanding why the following behaviour of parallel collections in scala should be the expected one.
Consider the following piece of code
If the code above is ran with CHANGE_ME = false you will immediately observe
showing that the current parallelism is 2, which is correct since the internal parallel collection
witnessing that the internal parallel collection is using threads that should be bound to the external parallel collection.
I guess the reason has to be found in the
where it is the current thread identity that drive the pool where the task is pushed.
JVM: java version "1.8.0_121"
It looks like similar behavior was subsequently fixed in the default executor.
although 2.12.5 won't be released until 2018, note that we do publish nightly builds of Scala
oh, but I see you're on 2.11, actually. ah well
note that as of Scala 2.13, the parallel collections will be a separately versioned module with its own release schedule, so it will become possible to get bugfixes like this out in a more timely manner