-
Notifications
You must be signed in to change notification settings - Fork 21
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
Future's Flatmap is not stacksafe #11256
Comments
This is not a bug. Your Execution context is not stack safe. |
Think of ExecutionContext as the Interpreter, where the "next actions" enter through |
@viktorklang I try this because of |
Seems it's |
Task/IO are only stacksafe when their interpreters are stack safe. This is also true for Future. For some examples on how to make stacksafe ExecutionContexts, look at: https://github.com/scala/scala/blob/2.13.x/src/library/scala/concurrent/BatchingExecutor.scala which is used by this. :) |
thanks, I was expecting it will be safe in any way. |
@viktorklang So,now anyone want to make it safe then will need to take care of the |
@hepin1989 Not necessarily :) Most thread pools are stack safe by definition since they add new Runnables to a queue. (just like the BatchingExecutor does). |
@viktorklang But I do expect even I call |
@hepin1989
|
It's ok with 100,but not 1000
The text was updated successfully, but these errors were encountered: