Closed GoogleCodeExporter closed 8 years ago
While coroutines have the good property that they can "contain" asynchrony in a
function without "leaking" the
asynchrony to its callers, this introduces dangerous interleaving ("plan
interference") hazards. If a function 'f'
previously worked synchronously, but now uses the proposed `await` construct,
then it would cause all of its
callers to "block" as well, without those callers being notified of this. Using
`when`, f must return a future, thus
changing its return type, requiring its callers to adapt to the new semantics.
Thus, they are warned that f cannot
complete atomically in a single turn anymore, and can take this into account.
Original comment by tvcut...@gmail.com
on 20 Mar 2010 at 6:39
Original issue reported on code.google.com by
tvcut...@gmail.com
on 21 Jul 2009 at 5:08