3 ms·
I'll say. That's how C# handles async too
by 2fast4you 4y ago
I'll say. That's how C# handles async too
- throwawaymaths 4y agoC# is in a highly managed VM, so I can't see how it would be the same as zig. The alternative (high level) way to have "nice" async, which, if c# is similar to zig I think they made "the wrong choice" is to layer async over green threads/cooperative multithreading + message passing/channels. Elixir's Task.async function is I think very well done, leveraging the isolation of erlang's VM and doing a whole ton of things "just right" (a future is process id + unique reference, monitoring the task when you await, e.g)
- 2fast4you 4y agoI was talking just about a sync functions being compiled to a state machine. It’s been awhile but I’m pretty sure C# does the same thing
- throwawaymaths 4y agoGot it. Thanks for clarifying. That seems like a not- unreasonable choice for a HLL like c#, though I'm still baffled they didn't go with something like Task.async