title: Can a critical section indefinitely stall a processor?
body: <p>So imagine I have code similar to the following:</p>
  
  <pre><code>var obj = new object();
  lock (obj)
  {
      while (true);
  }
  </code></pre>
  
  <p>Since the loop will run forever, and since the loop is in a critical section:</p>
  
  <p>Will this take up all of the processor's time, never yielding to another thread? I believe once a processor is in a critical section it cannot be interrupted until it leaves the critical section, so that the operations in the lock are atomic.</p>
  
  <p>Could this technique be used to guarantee that your application always has a core to run on, and is never waiting?</p>