What happens when a .NET console app blocks on Console.ReadLine()?
<p>I had an interesting interview question today. Consider you have the following console application:</p>

<pre><code>static void Main(string[] args) 
{
    Console.WriteLine("Hello world");
    Console.ReadLine();
}
</code></pre>

<p>When the Console.ReadLine() line is reached execution is suspended and the program waits for input from the keyboard. How many threads are there at this point and what state are they in, e.g. Running, Suspended, etc. ?</p>

<p>I suppose what the interviewer was after was awareness/understanding of the threads that make up a .NET console app and how they work together to interact with the IO subsystem of the underlying OS.</p>