Linked Questions
16 questions linked to/from Why would I bother to use Task.ConfigureAwait(continueOnCapturedContext: false);
0 votes
0 answers
979 views
Why use ConfigureAwait(false) in async database layer operations? [duplicate]
I am trying to get my head around ConfigureAwait(false) and came across this https://devblogs.microsoft.com/dotnet/configureawait-faq/ From what I understand, and please correct me if I am wrong, is ...
1 vote
0 answers
90 views
await task.ConfigureAwait(false) in C# [duplicate]
I use async/await extensively almost everywehrre. But I saw it enough in a few places that brought my attension. What is the benefit of await task.ConfigureAwait(false) in C#? Does turning on or off ...
688 votes
4 answers
292k views
Best practice to call ConfigureAwait for all server-side code
When you have server-side code (i.e. some ApiController) and your functions are asynchronous - so they return Task<SomeObject> - is it considered best practice that any time you await functions ...
453 votes
2 answers
479k views
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). Basically I am ...
39 votes
1 answer
27k views
Why is writing ConfigureAwait(false) on every line with await always recommended and do I really need it?
The question is not about what ConfigureAwait does. But rather why literally everywhere I see something like As a general rule, yes. ConfigureAwait(false) should be used for every await unless the ...
36 votes
1 answer
16k views
Why do i need to use ConfigureAwait(false) in all of transitive closure?
I am learning async/await and after I read this article Don't Block on Async Code and this Is async/await suitable for methods that are both IO and CPU bound I notice one Tip from @Stephen Cleary 's ...
12 votes
1 answer
5k views
In Unity specifically, "where" does an await literally return to?
In Unity, say you have a GameObject . So, it could be Lara Croft, Mario, an angered bird, a particular cube, a particular tree, or whatever. (Recall that Unity is not OO, it's ECS. The Components ...
12 votes
1 answer
15k views
Await Task Not returning after completion
I'm having an issue where a task is completing, but not returning back. I have a website and a web service on different servers. The website makes a call to the web service which utilizes a library ...
2 votes
1 answer
1k views
Correct use of ConfigureAwait(false) when chaining tasks
So I have a method that chains tasks together to do work var tasks = new List<Task>(); tasks.Add(DoWorkAsync(1)); tasks.Add(DoWorkAsync(2)); tasks.Add(DoWorkAsync(3)); tasks.Add(DoWorkAsync(4))...
5 votes
2 answers
1k views
SqlConnection OpenAsync blocks UI when SQL Server is shutdown
I have simple WPF client application (.NET 4.6.2) with one button. SqlConnection.OpenAsync method blocks the UI thread when following steps are done: SQL Server is started and reachable from client ...
4 votes
1 answer
886 views
What does ConfigureAwait(false) in an async await foreach loop do?
I am trying to understand the impact of setting ConfigureAwait(false) in an async foreach loop? await foreach (var item in data.ConfigureAwait(false)) { //... } Exactly where do we lose the ...
2 votes
1 answer
1k views
Why would DeviceClient SetDesiredPropertyUpdateCallbackAsync timeout immediately after OpenAsync succeeded?
As part of my initialization of an IoTHub DeviceClient I explicitly open the connection with OpenAsync and then immediately call SetDesiredPropertyUpdateCallbackAsync. Sometimes when I call ...
-1 votes
2 answers
242 views
Chaining async/await
I developing many algorithms that did most of the threading by themselves by using regular Threads. The approach was always as following float[] GetData(int requestedItemIndex) With the method above ...
0 votes
0 answers
104 views
Weird Task.Run behavior => getting back on UI
I've read lots of articles, completed a linked-in learning course and am still confused by async / await and Task.Run(). I have a WinForms app. I want to connect to two databases, and if the ...
-1 votes
1 answer
67 views
Threading background questions
I like threads, but I can't find any information on the Internet (maybe I just don't Know how to search for that properly) regarding what happen in the background when for example thread starvation is ...