title: What is the best way to wait for a variable in a multithreaded application
body: <p>I would like to do something like the below for a multi-threaded program:</p>
  
  <pre><code>// wait for variable to become true but don't hog resources  
  // then re-sync queues  
  </code></pre>
  
  <p>Is <a href="http://bytes.com/topic/c-sharp/answers/447370-how-do-i-wait-until-myvar-true" rel="noreferrer">something like this</a> a good solution?</p>
  
  <pre><code>while (!ready) {
      Thread.Sleep(250); // pause for 1/4 second;
  };
  </code></pre>