How to prevent inheriting CPU affinity by child forked process?

后端 未结 1 851
Happy的楠姐
Happy的楠姐 2020-12-11 05:42

I have a server process that forks many child processes. The server process has affinity to a CPU core, but I don\'t want that affinity to be inherited by child process (rat

相关标签:
1条回答
  • 2020-12-11 06:30

    You can call sched_setaffinity(2) with all bits set in CPU mask after the fork(2) and before the execve(2).

    0 讨论(0)
提交回复
热议问题