title: Task.Yield - real usages?
body: <p>I've been reading about <code>Task.Yield</code> , And as a Javascript developer I can tell that's it's job is  <strike><em>exactly</em></strike> the same as <code>setTimeout(function (){...},0);</code> in terms of letting the main single thread deal with other stuff aka :</p>
  
  <blockquote>
    <p>"don't take all the power , release from time time - so  others would
    have some too..."</p>
  </blockquote>
  
  <p>In js it's working particular in long loops. ( <em>don't make the browser freeze...</em>)</p>
  
  <p>But I saw this example <a href="http://books.google.co.il/books?id=qgq8T4X3erIC&amp;pg=PA574&amp;lpg=PA574&amp;dq=%22the%20task.yield%20method%20creates%22&amp;source=bl&amp;ots=94eP29Nmls&amp;sig=XxEvfX6PVmXhdOdOJC7dlJUGf0I&amp;hl=en&amp;sa=X&amp;ei=t7ZjU5WTJoaxO-f4gXg&amp;ved=0CCYQ6AEwAA#v=onepage&amp;q=%22the%20task.yield%20method%20creates%22&amp;f=false" rel="noreferrer">here</a> : </p>
  
  <pre><code>public static async Task &lt; int &gt; FindSeriesSum(int i1)
  {
      int sum = 0;
      for (int i = 0; i &lt; i1; i++)
      {
          sum += i;
          if (i % 1000 == 0) ( after a bulk , release power to main thread)
              await Task.Yield();
      }
  
      return sum;
  }
  </code></pre>
  
  <p>As a JS programmer I can understand what they did here.</p>
  
  <p>BUT as a C# programmer I ask myself  : why not open  a task for it ?</p>
  
  <pre><code> public static async Task &lt; int &gt; FindSeriesSum(int i1)
      {
           //do something....
           return await MyLongCalculationTask();
           //do something
      }
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>With Js I can't open a Task (<em><sup>yes i know i can actually with web workers</sup></em>) . But with c# <strong>I can</strong>.</p>
  
  <p><strong>If So</strong> -- why even bother with releasing from time to time while I can release it at all ?</p>
  
  <h1>Edit</h1>
  
  <p><strong>Adding references :</strong> </p>
  
  <p>From <a href="http://books.google.co.il/books?id=qgq8T4X3erIC&amp;pg=PA574&amp;lpg=PA574&amp;dq=%22the%20task.yield%20method%20creates%22&amp;source=bl&amp;ots=94eP29Nmls&amp;sig=XxEvfX6PVmXhdOdOJC7dlJUGf0I&amp;hl=en&amp;sa=X&amp;ei=t7ZjU5WTJoaxO-f4gXg&amp;ved=0CCYQ6AEwAA#v=onepage&amp;q=%22the%20task.yield%20method%20creates%22&amp;f=false" rel="noreferrer">here</a> : 
  <img src="https://i.stack.imgur.com/mDeX7.jpg" alt="enter image description here"></p>
  
  <p>From <a href="http://books.google.co.il/books?id=I-dHxFjfbi8C&amp;pg=PA65&amp;lpg=PA65&amp;dq=%22task.yield%28%29%22%20%20books&amp;source=bl&amp;ots=QwX60qDOeN&amp;sig=6YlwxL1aX_OuYzpU8ENoYUM8TR0&amp;hl=en&amp;sa=X&amp;ei=O5lkU5zKBumM7Qbqx4BY&amp;ved=0CDIQ6AEwAQ#v=onepage&amp;q=%22task.yield%28%29%22%20%20books&amp;f=false" rel="noreferrer">here</a> (another ebook): </p>
  
  <p><img src="https://i.stack.imgur.com/KS3Xq.jpg" alt="enter image description here"></p>