3 ms·
They are similar in that F# was the first .NET language to say, "what could language constructs for asynchrony look like?" and implement it. They are fundament
by edgyswingset 10y ago
They are similar in that F# was the first .NET language to say, "what could language constructs for asynchrony look like?" and implement it.
They are fundamentally different models, though.
F# uses a "cold task" model where invoking an async function returns a specification of work, which you must then start. You can start this work in different ways so that you have control over the semantics of how it executes.
C# uses a "hot task" models, where invoking the async method returns a handle to background work that has already been "kicked off". This is actually an oversimplification, because the semantics of what is actually the asynchronous thing you're awaiting can differ. But the overall concept follows this pattern.