4 ms·
How does F# or C# async compare to GCD on Objective-C / Swift ? Is it similar?
by youngthugger 12y ago
How does F# or C# async compare to GCD on Objective-C / Swift ? Is it similar?
- Strilanc 12y agoC#'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#.