Quote:
Am i right that this concept is NOT used to ensure UI Responsiveness?
No -
async
/
await
is great at ensuring UI responsiveness, if used correctly.
Things which are CPU-bound, or which run synchronously, can still cause problems. Eg: calling
Thread.Sleep
on the UI thread will freeze the UI. But there are usually alternatives that will keep the UI responsive - eg: using
Task.Delay
instead of
Thread.Sleep
. And if all else fails, you can push the CPU-bound code onto a background thread by using
Task.Run
.
Unfortunately, the
System.IO
classes don't provide asynchronous methods for enumerating or copying files, so you're unlikely to see any benefit from
async
in this case.