title: C++11 How can i get thread again from OS in a isolated core?
body: <p>Here is the question, I got a thread which is assigned to certain cpu core. In that thread I would like to create another thread which should on non-isolated cpus (not on isolated cpu in that it is created).</p>
  
  <pre><code>    std::thread th2;
  
  std::thread th1([&amp;] () {
  
  
      th2 = std::thread([&amp;] () {
  
          //do something;
      });
  
  });
  
  
  cpu_set_t cpu_set;
  CPU_ZERO(&amp;cpu_set);
  CPU_SET(core, &amp;cpu_set); // lets say 2
  pthread_setaffinity_np(th1.native_handle(), sizeof(cpu_set_t), &amp;cpu_set);
  
  
  th2.join();
  th1.join();
  </code></pre>
  
  <p>that causes unintended context switching is there any way to say internal thread get cpu from OS again (without explicit cpu affinity) ?</p>