|
|
|
|
|
by zenbowman
3927 days ago
|
|
One correction: Futures are not necessarily run on a separate thread pool. If that were always true, they would offer no performance advantage over the thread-per-function or thread-per-request model, and would burden us with more complex code. The advantage of futures comes when they are used in conjunction with AIO, they provide a decent abstraction for dealing with it. The performance benefits come from using AIO, Futures just provide a convenient way to deal with the results. If Play was built on Tomcat instead of Netty, and you made various blocking calls inside the functions called by the Futures, you wouldn't get any performance benefits. |
|
I try to add something in the end about thread pools. I didn't want to go into the thread/Core, different thread pools for IO/computation and thread pool for blocking direction to make it more complex.