title: How to terminate a std::future?
body: <p>I'm confused by something about C++11 <code>std::future</code>. I want to balance work load dynamically, so if there are some processors idle, I create a <code>std::future</code> with <code>std::async</code> to divide the remaining data. It works fine.</p>
  
  <pre><code>std::future&lt;int&gt; f[MAX_CHILD];
  for ( each data item ){
      if ( found_idle_processor )
          f[i] = std::async( ... );
  
      process();
  }
  
  // At last, query the result of f.
  for ( each future )
      hold = f[i].get();
  </code></pre>
  
  <p>But sometimes, once some special data items were found, all other data will be discarded and the program should give the final result immediately, then another task will be launched.</p>
  
  <pre><code>std::future&lt;int&gt; f[MAX_CHILD];
  for ( each data item ){
      if ( found_idle_processor )
          f[i] = std::async( ... );
  
      process();
  
      if ( found_special_item )
          return final_result;
  }
  // At last, query the result of each f.
  for ( each future )
      hold = f[i].get();
  </code></pre>
  
  <p>But the created <code>f</code> are out of my control, are they still running after return? how can I terminate them to release CPU time they used?</p>