title: async-await threading internals
body: <p>I'm curious about async await threading internals.</p>
  
  <p>Everyone states that async is so much better in case of performance, because it frees threads that are waiting for a response to a long asynchronous call.
  Ok I get it.</p>
  
  <p>But let's consider this scenario.</p>
  
  <p>I have an async methodA executing an async operation on database.
  The api of the database exposes function BeginQuery and event QueryCompleted.
  I wrapped those with a task (with use of TaskCompletionSource).</p>
  
  <p>My question is what is going under the hood between calling BeginQuery and firing event QueryCompleted.</p>
  
  <p>I mean - doesn't it need to spawn some kind of worker to fire the event? At the very low level it must be some synchronous loop that is blocking a thread reading result from db.</p>
  
  <p>What I suppose is that any async call must generate a thread to actually handle the response (maybe wait for it in a low level c++ loop in driver code).</p>
  
  <p>So our only "gain" is that the caller thread can be freed when some other thread is doing its work.</p>
  
  <p>Does calling an asynchronous method always create a new worker thread?</p>
  
  <p>Could someone confirm my understanding?</p>
  
  <p><img src="https://i.stack.imgur.com/8gA9P.png" alt=""></p>