AFAIK, it is possible开发者_JS百科 to assign a thread to a CPU core in Linux. (see this). But, my question is can I achieve this functionality using boost and if it is possible, then how? Please, also not that OS can decide which is better for me, but assume that I want to control this behavior in my design.
Boost is meant to be a cross platform library while the question you linked to points toward a OS specific implementation which to my knowledge is the only way to do what you are asking.
In Windows OS you can use SetThreadAffinityMask API call for this. I don't see how boost fits in what you need.
The topic is called "thread affinity", you could find the response by searching for this plus your exact operating system version.
精彩评论