title: Dynamically create thread in c++
body: <p>i have an queue of urls and i an processing it with some function i need to run some 10 thread to read 10 website at same time ,,,</p>
  
  <pre><code>boost::thread tl(boost::bind(&amp;thread::start, crawl, url));
  </code></pre>
  
  <p>we can use for loop but is that is the only way to use to create dynamic thread....</p>
  
  <p>Edited</p>
  
  <pre><code> while(!q.empty())
                       {
  
  
                           boost::thread_group Tg;
                           for(int k=0;k&lt;=1;k++)
                           {
  
                           Tg.create_thread(boost::bind(&amp;threadMaster::start, mastercrawl, q.front()));
                           Tg.join_all();
  
                           }
                       }
  </code></pre>
  
  <p>this works as single thread and </p>
  
  <pre><code> Tg.create_thread(boost::bind(&amp;threadMaster::start, mastercrawl, "http://www.google.co.in"));
                                   Tg.create_thread(boost::bind(&amp;threadMaster::start, mastercrawl, "http://www.yahoo.com"));
  </code></pre>
  
  <p>this works as multi thread  how can i make it work my first program as multithread  </p>