hello, 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 ,,,
boost::thread tl(boost::bind(&thread::start, crawl, url));
we can use for loop but is that is the only way to use to create dynamic thread....
Edited
while(!q.empty())
{
boost::thread_group Tg;
for(int k=0;k<=1;k++)
{
Tg.create_thread(boost::bind(&threadMaster::start, mastercrawl, q.front()));
Tg.join_all();
}
}
this works as single thread and
Tg.create_thread(boost::bind(&threadMaster::start, mastercrawl, "http://www.google.co.in"));
Tg.create_thread(boost::bind(&threadMaster::start, mastercrawl, "http://www.yahoo.com"));
this works as multi thread how can i make it work my first program as multithread