Linked Questions

54 votes
1 answer
23k views

When should I use async/await and when should I use parallel.foreach in C#? Are parallel and async/await serve the same purpose? What are the differences in them?
AUser123's user avatar
  • 731
23 votes
4 answers
2k views

Let's say I have two async methods public async static Task RunAsync1() { await Task.Delay(2000); await Task.Delay(2000); } and public async static Task RunAsync2() { var t1 = Task.Delay(...
Roman Marusyk's user avatar
5 votes
2 answers
7k views

I'm programming a client app on WinRT in C# which connects to several servers by TCP. For the TCP connection I use StreamSocket. The Input and Output Strings are then wrapped in a DataWriter and a ...
mentras's user avatar
  • 131
3 votes
3 answers
2k views

I'm currently implementing a System.Web.Http.IActionFilter which calls an internal service to determine whether the current request can continue. The problem I'm having is returning a Task<T1> ...
Benjamin Fox's user avatar
  • 5,800
1 vote
3 answers
2k views

I have an existing large ASP.NET (ASP.NET Web Forms + MVC support) Application and trying to implement async programming on project. For that I created a completely new POC by selecting ASP.NET ...
Abhimanyu's user avatar
  • 2,223
6 votes
2 answers
572 views

From the wikibook on F# there is a small section where it says: What does let! do?# let! runs an async<'a> object on its own thread, then it immediately releases the current thread ...
kasperhj's user avatar
  • 10.6k
2 votes
2 answers
408 views

You can only await an async method. However that async method itself needs to have an await statement inside it itself. Doesn't this lead to an infinite regression?
David Klempfner's user avatar
2 votes
1 answer
1k views

I have created some sample ViewModel to test usage of DPs with asyncCtp: public class SampleVm : DependencyObject { public static readonly DependencyProperty SampleDependencyPropertyProperty = ...
mehdi.loa's user avatar
  • 565
0 votes
1 answer
167 views

In the following example there are two ways of calling code enter link description here Task<Egg> taskEggs = FryEggsAsync(2); Egg eggs = await taskEggs; Such code runs parallel, ...
alekoo73's user avatar
  • 935
1 vote
2 answers
68 views

My application sends the users credentials to the server, if they are correct the server send a packet telling the client their credentials are wrong or right. After a couple of dummy tests, my client ...
Moynul's user avatar
  • 635