The thread mapper allows to map threads to specific core using a predefined mapping policy.
More...
The thread mapper allows to map threads to specific core using a predefined mapping policy.
The threadMapper stores a list of CPU ids. By default the list is simply a linear sequence of core ids of the system, for example in a quad-core system the default list is 0 1 2 3. It is possible to change the default list using the method setMappingList by passing a string of space-serated (or comma-separated) CPU ids. The policy implemented in the threadManager is to pick up a CPU id from the list using a round-robin policy.
This class is defined in mapper.hpp
void ff::threadMapper::setMappingList |
( |
const char * |
str | ) |
|
|
inline |
It allows to set a new list of CPU ids.
The str variable should contain a space-separated or a comma-separated list of CPU ids. For example if the string str is "0 1 1 2 3", then the first thread will be bind to CPU 0, the second to CPU 1, the third to CPU 1, the fourth to CPU 2, the fifth to CPU 3. Then it follows the same rule for the subsequent threads.
- Returns
- TODO
References ff::svector< T >::push_back(), ff::svector< T >::reserve(), and ff::svector< T >::size().