About 124,000 results
Open links in new tab
  1. Understanding async / await in C# - Stack Overflow

    18 Understand C# Task, async and await C# Task Task class is an asynchronous task wrapper. Thread.Sleep (1000) can stop a thread running for 1 second. While Task.Delay (1000) won't …

  2. c# - What is the difference between task and thread? - Stack …

    Nov 9, 2010 · In C# 4.0, we have Task in the System.Threading.Tasks namespace. What is the true difference between Thread and Task. I did some sample program (help taken from …

  3. c# - Regarding usage of Task.Start () , Task.Run () and Task.Factory ...

    Apr 17, 2015 · Tell me, are Task.Start(), Task.Run() and Task.Factory.StartNew() all used for the same purpose or do they have different significance? When should one use Task.Start(), when …

  4. c# - How do I get the result or return value of a Task? - Stack …

    Can someone explain to me how to return the result of a Task? I currently am trying to do the following but my Tasks are not returning my List that I expect? What is the problem here? …

  5. When correctly use Task.Run and when just async-await

    I would like to ask you on your opinion about the correct architecture when to use Task.Run. I am experiencing laggy UI in our WPF .NET 4.5 application (with Caliburn Micro framework). …

  6. Is Task.Result the same as .GetAwaiter.GetResult ()?

    351 Task.GetAwaiter().GetResult() is preferred over Task.Wait and Task.Result because it propagates exceptions rather than wrapping them in an AggregateException. However, all …

  7. c# - When would I use Task.Yield ()? - Stack Overflow

    Nov 3, 2022 · I'm using async/await and Task a lot but have never been using Task.Yield() and to be honest even with all the explanations I do not understand why I would need this method. …

  8. c# - async/await - when to return a Task vs void? - Stack Overflow

    Normally, you would want to return a Task. The main exception should be when you need to have a void return type (for events). If there's no reason to disallow having the caller await your …

  9. How do I wait until Task is finished in C#? - Stack Overflow

    Nov 3, 2012 · How do I wait until Task is finished in C#? Asked 13 years, 1 month ago Modified 5 years, 1 month ago Viewed 208k times

  10. c# - HttpClient - A task was cancelled? - Stack Overflow

    Mar 21, 2015 · 30 I ran into this issue because my Main method wasn't waiting for the task to complete before returning, so the Task<HttpResponseMessage> was being cancelled when …