Understanding discrepancy between POSIX and Linux/glibc sched_* functions Understanding discrepancy between POSIX and Linux/glibc sched_* functions linux linux

Understanding discrepancy between POSIX and Linux/glibc sched_* functions


I believe the reason is that it has been this way since before NPTL was implemented, and nobody has contributed thread-group-wide scheduling attribute support to the kernel, so these functions just still do the what they have always done.

And possibly because, as you point out, the way POSIX specifies them would not really be at all useful without process contention scope …


The rationale for the behaviour of sched_setparam etc. in Linux is that threads are in fact processes created by the clone(2) system call, cf. glibc/nptl/sysdeps/pthread/createthread.c.