Hi,
----- Original Message -----
From: "Lennyk"
Hi,
I'm running on Linux and I would like to set a specific thread affinity to each thread I create (i.e. setting each thread to run on a different core/CPU). How can this be done using the boost::thread library?
Oliver Kowalke, the author of the Boost.ThreadPool has posted a compressed file boost-bind_processor.v1.tar.gz in Boost Vault http://www.boostpro.com/vault/index.php?directory=Concurrent%20Programming&PHPSESSID=96307fee8086c06036af42fae790b449 This file contains functions which allows bind/unbind current thread to a processor boost::this_thread::bind_to_processor( unsigned int n); // thread gets bound to processor n boost::this_thread::bind_to_any_processor(); // thread can be scheduled to all available processors Both functions will throw boost::system_error. Processors are enumerated starting at 0. HTH, Vicente