3 ms·
What's an alternative to async/await that's explicit about runtime costs?
by nynx 6y ago
What's an alternative to async/await that's explicit about runtime costs?
- thu2111 6y agoHow explicit do you want? The loom model is VM managed thread stacks with user space context switching. The costs are all quantifiable and a suspended "virtual" thread uses memory directly proportional to the amount of stuff on the stack, same as any coro implementation. However there is no async/await or coloured functions. The VM just makes threads super cheap
- roca 6y agoRust started off with user ("green") threads. The problem is interop with other code via FFI --- it gets really painful and potentially expensive. That's not good for a systems language. So they ripped it out.