-
Notifications
You must be signed in to change notification settings - Fork 30
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
Starvation situations with fixed thread pools #55
Comments
@axel22 should https://docs.scala-lang.org/overviews/parallel-collections/configuration.html say something about this? |
Maybe we should add a recommendation to use only ForkJoinPools to that documentation. |
Isn’t that hiding the symptoms though? Sure, it’s best to use a ForkJoinPool, but we still have perfectly legal code that deadlocks |
This seems to stem from the implementation of
The issue is that
In theory, if the number of threads you define for your executor is: Stack trace from an experiment.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Do we actually know whether @nrinaudo's original report is 2.12+-only? I don't know for sure, but I suspect this ticket has become a grab bag of "parallel collections didn't work for me, in my code" reports that may or may not have anything to do with each other. In particular, I suspect overlap with scala/bug#8119 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I have hidden many comments which turned out to be unrelated to the original bug report. Before commenting on this ticket, please be very sure that what you are encountering is exactly the specific issue that Nicolas has identified, rather than just any starvation or deadlock issue. |
Parallel collections that use a fixed thread pool for task support and contain "too many" elements will deadlock, where "too many" is a value I haven't been able to qualify.
The simplest possible reproduction is the empty list with a thread pool of 1:
I have observed the same starvation issue with larger thread pools and lists, but not reliably enough to provide a reproduction case.
The text was updated successfully, but these errors were encountered: