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()));
What is the correct way to determine the number of running/busy threads (thread_count)? 
Hotmail: Powerful Free email with security by Microsoft.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at