$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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