|
|
|
|
|
by cwills
574 days ago
|
|
Seems like this article conflates threads C# with asynchronous operations a little. The way I see it, threads are for parallel & concurrent execution of CPU-bound workloads, across multiple CPU cores. And typically use Task Parallel Library. Async/await won’t help here. Whereas async/await for IO bound workloads, and freeing up the current CPU thread until the IO operation finishes. As mentioned, syntactic sugar on top of older callback-based asynchronous APIs. |
|
> You could also have CPU-bound code, such as performing an expensive calculation, which is also a good scenario for writing async code.
[1]: https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous...