Calvin Spealman wrote:
If we don't kick whatever handles the callback and result immediately, we are essentially re-introducing pre-emptive scheduling. If TaskA is waiting on the result of TaskB, and when TaskB finishes we say "OK, but we need to go let TaskC do something before TaskA is given that result" then we leave room for C to break things, modify state, and generally act in a less-than-determinable way.
I don't see how the risk of this is any higher than the risk that some other task D gets run while task A is waiting and messes something up.
Ultimately you have to trust your tasks to behave themselves.