Hacker News new | ask | show | jobs
by youngthugger 4236 days ago
How does F# or C# async compare to GCD on Objective-C / Swift ? Is it similar?
1 comments

C#'s equivalent of GCD is, very roughly, Task. You can create tasks that compute results on the thread pool, give them continuations to run after, etc.

Async/await is an abstraction on top of tasks, where you write code with do-while loops and try-catch and it gets translated into GCD-esque continuation-using code. It lets you write the asynchronous code in an imperative style, so it looks more like the rest of the code you write in C#.