Search⌘ K

Mixing Asynchronous and Synchronous Code

Explore how mixing asynchronous and synchronous code affects API performance and thread pool usage. Learn to use tools like the .NET Async Performance Profiler to identify inefficiencies. Understand why ensuring all I/O calls remain asynchronous in async methods is critical for scalable and responsive web applications.

Steps to mix asynchronous and synchronous code

An easy mistake to make is to mix asynchronous code with synchronous code. Let's find out what happens when this happens by changing the GetUnansweredQuestions action method:

  1. Change this method to call the synchronous version of GetUnansweredQuestions in ...