Am 27.03.2015 um 17:06 schrieb Dicebot:
On Friday, 27 March 2015 at 15:28:31 UTC, Ola Fosheim Grøstad wrote:
No... E.g.:

On the same thread:
1. fiber A receives request and queries DB (async)
2. fiber B computes for 1 second
3. fiber A sends response.

Latency: 1 second even if all the other threads are free.

This is a problem of having blocking 1 second computation in same fiber
pool as request handlers -> broken application design. Hiding that issue
by moving fibers between threads is just making things worse.

Exactly, the problem will remain there, even with moving fibers around, because you might as well have the same situation in all of the threads at the same time like that. It always makes sense to have dedicated threads for lengthy computations. Apart from that, long computations can call yield() every now and then to avoid this kind of issue in the first place.

Reply via email to