title: C++ multi thread in loop
body: <p>There is a loop which i want to do it in async().</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;thread&gt;
  #include&lt;iostream&gt;
  #include &lt;future&gt;
  using namespace std;
  void Compute( int i)
  {
      printf("i=%d\n",i);
      std::this_thread::sleep_for(std::chrono::seconds(1));
  }
  int main()
  {
      for(int i=0;i&lt;99999;++i)
          std::async(std::launch::async, Compute, i);
  }
  </code></pre>
  
  <p>The result is that the loop will finish the job then jump to next iteration.
  For example, 
    i=0-->(1sec)-->i=1-->(1sec)-->i=2-->....
  How to do it continuously without waiting the last iteration?</p>