Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::thread to keep all cores busy
From: Internet Retard (webretard_at_[hidden])
Date: 2010-07-26 11:38:53


You only launch *two* tasks. They keep going back to the

queue to get new work when they finished their current item.

---
Perhaps something like this then:
    while ( !jobs.empty() )
    {
        if ( thread_count < cores )
        {
            boost::thread t(boost::bind(&worker, jobs.front()));
            jobs.pop();
            t.join();
       }
    }
What is the correct way to determine the number of running/busy threads (thread_count)? 
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net