title: How to divide FOR loop in N even parts for parallel execution given constant input data for each iteration?
body: <p>I have a time consuming loop I would like to execute in parallel.
  Pseudocode:</p>
  
  <pre><code>for(int n = 0; n &lt; 2048; n++)
  {
    output_data[n] = function(constant_input_data, n)
  }
  </code></pre>
  
  <ul>
  <li>Input data for each iteration is completely the same</li>
  <li>Output for Nth iteration is stored in array with index N.</li>
  </ul>
  
  <p>How to divide this loop in C equal parts, where C is CPU core count?</p>
  
  <p>What is the best and the most elegant way to do this in C#, .net?</p>