Results 1 to 3 of 3

Thread: Thread Affinity and Scheduling Policy Inheritance C/C++

  1. #1
    Join Date
    Apr 2008
    Beans
    221

    Thread Affinity and Scheduling Policy Inheritance C/C++

    Does the child thread in POSIX standard, inherit the affinity and priority of the parent thread?
    Does the child thread in POSIX standard, inherit the scheduling policy from the parent thread?

  2. #2
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: Thread Affinity and Scheduling Policy Inheritance C/C++

    Quote Originally Posted by akvino View Post
    Does the child thread in POSIX standard, inherit the affinity and priority of the parent thread?
    AFAIK, it does not do so, although if you do not specify a priority for the thread, then presumably it will have the same priority as the parent thread. If you want a new thread to inherit the attributes of the parent thread, use pthread_attr_setinheritsched() using the appropriate option of PTHREAD_INHERIT_SCHED.

    Read the man-page for pthread_setschedparam for more details.

    As for the affinity, I do not know. I have never used this feature.

    Quote Originally Posted by akvino View Post
    Does the child thread in POSIX standard, inherit the scheduling policy from the parent thread?
    Again, AFAIK, it does not. Refer to my response above.

  3. #3
    Join Date
    Apr 2008
    Beans
    221

    Re: Thread Affinity and Scheduling Policy Inheritance C/C++

    so on the man page I found this:
    http://www.kernel.org/doc/man-pages/..._create.3.html


    Linux-specific details

    The new thread inherits copies of the calling thread's capability sets (see
    capabilities(7)) and CPU affinity mask (see sched_setaffinity(2)).


    So it appears that it gets affinity.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •