Reputation: 21
If we are using the taskset for setting the particular process to run on a particular core by using the process pid. I want to know that all the child processes which will generated by the pid will also run on the particular core or uses any core.
Upvotes: 2
Views: 2232
Reputation: 358
taskset
calls sched_setaffinity(2)
(here) to specify the set of CPUs a thread is eligible to run on. As sched_setaffinity(2)
's manual states:
A child created via
fork(2)
inherits its parent's CPU affinity mask. The affinity mask is preserved across anexecve(2)
.
the child processes are allowed to run on the same set of CPUs as their parent.
Upvotes: 2