top | item 40463478

(no title)

leucippe | 1 year ago

The plan is to support async without function colouring.

I recommend this talk by Luke Wagner on async plans in WASI 0.3 (https://youtu.be/y3x4-nQeXxc) for background on how it will work.

To summarise, from an API perspective, the caller and callee won't know if the other is async or not. When calling async from non-async, an event loop is inserted at link-time and it blocks.* When calling non-async from async, the callee will get suspended if it tries to do blocking IO. That still leaves the problem of long-running compute without IO in a non-async context, but at least you're not wasting CPU time in that scenario.

* If the host runtime already has an event loop, I assume the callee will get added to that.

discuss

order

No comments yet.