Difference between Task and async Task

private async Task DoStuff() { /* stuff */ } private Task DoStuff { /* stuff */ } 

The non-async task in this case wants a return value, however, I haven't specified a TResult value for it. The asnyc one wants me to use the await keyword inside it, however, if I just want to do stuff on another thread (ex. building strings based off an array), the compiler gives me a warning because I'm not awaiting anything.

For what I'm doing, it does need to be awaited though (so I can write the strings to disk). I've looked into Task.Factory.ContinueWhenAll but I don't think that's right to use in this situation.

TL;DR what's the difference between Task and async Task?

by Shaken_U via /r/csharp

Leave a Reply