title: Reallocation of Automatic Variables in a Worker Thread
body: <p>Am I right in thinking that, in the following snippet, the automatic variables <code>x</code> and <code>y</code> will be reallocated on the stack on every pass of the while loop and never released, eventually leading to stack overflow? Will there also be 10 reallocations of <code>z</code> on each pass, before they are released after exciting from the scope of the inner <code>while</code> loop?</p>
  
  <p>If this snippet is placed in a worker thread, will the stack be saved for re-entry after the thread has served its time allocation, i.e., will <code>x</code> and <code>y</code> <em>never</em> be deallocated? </p>
  
  <pre><code>while (1)
  {
      int x = 0;
      int *y = &amp;x;
  
      while (x &lt; 10)
      {
          int z = 0;
          ++x;
      }
  }
  </code></pre>