title: pthread and main thread are running on same core by default in cygwin?
body: <p>I'm using multi-core machine, and tried to run this simple code few times:                  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;pthread.h&gt; 
  #include &lt;unistd.h&gt;
  
  int evenCounter = 0;
  
  int nextEven()
  {
      ++evenCounter;
      ++evenCounter;
      return evenCounter;
  }
  
  void* pThreadFunction()
  {
      int i, val;
      for (i = 0; i &lt; 8; i++)
      {
          val = nextEven();
          printf("*** increase from pThread - new Value is: %d\n", val);
      }
      pthread_exit(NULL);
  }
  
  void main(){
      pthread_t pThread;
      int i, val;
      if (pthread_create(&amp;pThread, NULL, pThreadFunction, NULL) != 0) 
      {
          puts("failed to create print thread");
          return 1;
      }
      for (i = 0; i &lt; 8; i++)
      {
          val = nextEven();
          printf("increase from main - new Value is: %d\n", val);
      }
  }          
  </code></pre>
  
  <p>And got results like those all the time:                   </p>
  
  <pre><code>increase from main - new Value is: 2
  *** increase from pThread - new Value is: 4
  increase from main - new Value is: 6
  *** increase from pThread - new Value is: 8
  increase from main - new Value is: 10
  *** increase from pThread - new Value is: 12
  increase from main - new Value is: 14
  *** increase from pThread - new Value is: 16
  increase from main - new Value is: 18
  *** increase from pThread - new Value is: 20
  increase from main - new Value is: 22
  *** increase from pThread - new Value is: 24
  increase from main - new Value is: 26
  *** increase from pThread - new Value is: 28
  increase from main - new Value is: 30
  *** increase from pThread - new Value is: 32               
  </code></pre>
  
  <p>(The order between the first printings was different sometimes, but the values were the same).<br>
  If those two threads run on different cores - I would expect some wrong values (like odd values) in the printings, so for my understanding - those threads run on the same core.             </p>
  
  <p>Is it really like that in cygwin?
  And if it is, how can I make main thread and the pthread run on different cores?<br>
  I saw an option for using <code>sched_setaffinity</code> , but it doesn't work in cygwin.</p>