3 ms·
It sounds like you're talking about multithreading in general rather than async specifically. If you don't need multithreading then you don't need async... that
by Renevith 11y ago
It sounds like you're talking about multithreading in general rather than async specifically. If you don't need multithreading then you don't need async... that's not too surprising.
I write an application that previously wasn't using threading to avoid blocking the UI. Certain long-running tasks would freeze the app for some time. It's not a big deal since it's an internal app for my work team, but now that the async syntax and semantics are a bit easier, I've started using them and my app is more responsive.
Async doesn't do anything fundamentally new. If you already implemented multithreading in your application that you're happy with, there's no compelling reason to switch to doing it the async way. But for new development it seems like it should be the default.
- mattmanser 11y agoI thought WPF did that for you? I only ever used Silverlight but I seem to remember the UI was on a different thread to the rest of it anyway.
- edgyswingset 11y ago> Async doesn't do anything fundamentally new. This is correct, but not in the way you're describing. The API calls that it ultimately makes have been in place before C# 5. C# 5 just made writing that kind of code significantly simpler than it was before. > If you already implemented multithreading in your application that you're happy with, there's no compelling reason to switch to doing it the async way. This isn't necessarily true. From the perspective of a client application, it's less resource-intensive to use async code than to spin up another thread. On mobile devices that's less battery life used, which is always a good thing. From the perspective of a server, multithreading only gets you so far, plus they can eat up tons of memory in the process. Async code does not spin up new threads and allows for spikes in traffic to be handled gracefully rather than (a) using tons of threads, or (b) being unable to handle the load at all.