• Re: Setting child proc affinity before fork() ?

    From Muttley@dastardlyhq.com@21:1/5 to Muttley@dastardlyhq.com on Sat May 31 16:49:47 2025
    On Sat, 31 May 2025 16:46:48 -0000 (UTC)
    Muttley@dastardlyhq.com wrote:
    The CPU_* macros and sched_setaffinity() etc allow you to try and force a >given process to run on a given CPU/core , but is there a way to set the >affinity of a process yet to be created by fork() ? Eg if I have a parent >process running on CPU 0 can I make it so that the child will run on CPU 1 >before the child is created so that the child itself doesn't have to set
    the affinity? I'm thinking of situations with fork-exec when the exec'd >binary won't set any affinity so the parent needs to do it for it.

    Thanks for any help.

    Ignore my post, I need to engage brain before posting next time. I just do
    it after the fork, before the exec. Duh.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Muttley@dastardlyhq.com@21:1/5 to All on Sat May 31 16:46:48 2025
    The CPU_* macros and sched_setaffinity() etc allow you to try and force a
    given process to run on a given CPU/core , but is there a way to set the affinity of a process yet to be created by fork() ? Eg if I have a parent process running on CPU 0 can I make it so that the child will run on CPU 1 before the child is created so that the child itself doesn't have to set
    the affinity? I'm thinking of situations with fork-exec when the exec'd
    binary won't set any affinity so the parent needs to do it for it.

    Thanks for any help.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)