-
Notifications
You must be signed in to change notification settings - Fork 29
Controlling parallelism in nested parallel collection #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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 |
The custom tasksupport as shown above is pretty easy workaround. I didn't verify it on 2.11 but it's probably OK. I was aware par would get spun out but didn't know it had already happened. I wonder if it will have partests. |
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
l
is bound to a task support with a fork-join thread pool with parallelism 2.If now you set CHANGE_ME = true, you will surprisingly observe
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
executeAndWaitResult
where it is the current thread identity that drive the pool where the task is pushed.
l
be bound then in situations where the parallel collection is created and operated in a ForkJoinWorkerThread ?JVM: java version "1.8.0_121"
Scala: 2.11.11
The text was updated successfully, but these errors were encountered: