ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix
. Something like launch-prefix="taskset -c 1"
added to a node
element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.
Note that according to taskset, your user needs to have CAP_SYS_NICE
.
Note also that the taskset
approach is not ROS specific. The launch-prefix
is (see roslaunch/XML/node - Attributes).
Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.
2 | No.2 Revision |
Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix
.
Something like launch-prefix="taskset -c 1"
added to a node
element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.
Note that according to taskset, your user needs to have CAP_SYS_NICE
.
Note also that the taskset
approach is not ROS specific. The launch-prefix
is (see roslaunch/XML/node - Attributes).
Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.
3 | No.3 Revision |
Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix
(taskset
is from the util-linux
package on Debian/Ubuntu).
Something like launch-prefix="taskset -c 1"
added to a node
element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.
Note that according to taskset, your user needs to have CAP_SYS_NICE
.
Note also that the taskset
approach is not ROS specific. The launch-prefix
is (see roslaunch/XML/node - Attributes).
Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.
4 | No.4 Revision |
Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix
(taskset
is from the util-linux
package on Debian/Ubuntu).
Something like launch-prefix="taskset -c 1"
added to a node
element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.
Note that according to tasksetman/1/taskset, your user needs to have CAP_SYS_NICE
.
Note also that the taskset
approach is not ROS specific. The launch-prefix
is (see roslaunch/XML/node - Attributes).
Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in cpu Y, obviously.
5 | No.5 Revision |
Without being able to get access to the underlying threads, I think it will be difficult (impossible) to do for individual threads, but for entire processes this should be doable using taskset and a launch-prefix
(taskset
is from the util-linux
package on Debian/Ubuntu).
Something like launch-prefix="taskset -c 1"
added to a node
element in a launch file should work (I haven't tested it though). That binds the node to cpu 2.
Note that according to man/1/taskset, your user needs to have CAP_SYS_NICE
.
Note also that the taskset
approach is not ROS specific. The launch-prefix
is ROS specific (see roslaunch/XML/node - Attributes).
Final note: the fact that you've bound task X to cpu Y does not mean that other tasks cannot be run in on cpu Y, obviously.