Click to See Complete Forum and Search --> : CPU Affinity in Boost::Thread API


farda
October 24th, 2011, 04:15 AM
Hi,

Does anyone knows if it's possible to set CPU affinity in boost threads ((i.e. setting each thread to run on a different CPU)? Is there any tutorial/documentation you can suggest on this? Googling does not return much info except the following thread where the specified example (boost-bind_processor.v1.tar.gz) is no longer present in the file server. Thanks.

http://lists.boost.org/boost-users/2009/02/45172.php

superbonzo
October 24th, 2011, 05:02 AM
I don't think there is a portable way of doing it; that said, you can always use the boost::thread::native_handle() member and your preferred OS api to set the affinity/proiority/etc.. of a thread.