Does POSIX require two levels of contention scope?
> I have a question concernign pthreads and POSIX. Does POSIX require that > there are two levels of contention scope supported > (PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS) for the pthreads? I > understand that many platforms support the 1-1 model, where one > user-level thread (ULT) maps to one kernel-level schedulable “entity”. POSIX requires an implementation to support AT LEAST ONE of the two contention scopes. While some may support both, that’s not required. Also, the only way to determine which scopes are supported is to try creating the threads and see whether one or the other fails. And note that anyone who can do “1 to 1” threads could easily “cheat” and claim to support both. There’s nothing a legal/portable program can do to detect whether the implementation has “lied” and given it a system contention scope (SCS) thread when it asked for PCS (process contention scope). The converse isn’t true: an implementation that gives a PCS thread when asked for an SCS thread is brok