Pthreads were first defined in the POSIX.1c standard (Threads extensions, IEEE Std 1003.1c-1995) from 1995 as an extension to the POSIX standard. At the time, UNIX had been chosen as a manufacturer-neutral interface, with POSIX unifying the various APIs among them.
Despite this standardization effort, differences still exist in Pthread implementations between OS's which implement it (for example, between Linux and OS X), courtesy of non-portable extensions (marked with _np in the method name).
For the pthread_setname_np method, the Linux implementation takes two parameters, allowing one to set the name of a thread other than the current thread. On OS X (since 10.6), this method only takes one parameter, allowing one to set the name of the current thread only. If portability is a concern, one has to be mindful of such differences.
After 1997, the POSIX standard revisions were managed by the Austin Joint Working Group. These revisions merge the threads extension into the main standard. The current revision is 7, also known as POSIX.1-2008 and IEEE Std 1003.1, 2013 edition--with a free copy of the standard available online.
OS's can be certified to conform to the POSIX standard. Currently, these are as mentioned in this table:
| Name | Developer | Since version | Architecture(s) (current) | Notes |
|
AIX |
IBM |
5L |
POWER |
Server OS |
|
HP-UX |
Hewlett-Packard |
11i v3 |
PA-RISC, IA-64 (Itanium) |
Server OS |
|
IRIX |
Silicon Graphics (SGI) |
6 |
MIPS |
Discontinued |
|
Inspur K-UX |
Inspur |
2 |
X86_64, |
Linux based |
|
Integrity |
Green Hills Software |
5 |
ARM, XScale, Blackfin, Freescale Coldfire, MIPS, PowerPC, x86. |
Real-time OS |
|
OS X/MacOS |
Apple |
10.5 (Leopard) |
X86_64 |
Desktop OS |
|
QNX Neutrino |
BlackBerry |
1 |
Intel 8088, x86, MIPS, PowerPC, SH-4, ARM, StrongARM, XScale |
Real-time, embedded OS |
|
Solaris |
Sun/Oracle |
2.5 |
SPARC, IA-32 (<11), x86_64, PowerPC (2.5.1) |
Server OS |
|
Tru64 |
DEC, HP, IBM, Compaq |
5.1B-4 |
Alpha |
Discontinued |
|
UnixWare |
Novell, SCO, Xinuos |
7.1.3 |
x86 |
Server OS |
Other operating systems are mostly compliant. The following are examples of the same:
| Name | Platform | Notes |
|
Android |
ARM, x86, MIPS |
Linux based. Bionic C-library. |
|
BeOS (Haiku) |
IA-32, ARM, x64_64 |
Limited to GCC 2.x for x86. |
|
Darwin |
PowerPC, x86, ARM |
Uses the open source components on which macOS is based. |
|
FreeBSD |
IA-32, x86_64, sparc64, PowerPC, ARM, MIPS, and so on |
Essentially POSIX compliant. One can rely on documented POSIX behavior. More strict on compliance than Linux, in general. |
|
Linux |
Alpha, ARC, ARM, AVR32, Blackfin, H8/300, Itanium, m68k, Microblaze, MIPS, Nios II, OpenRISC, PA-RISC, PowerPC, s390, S+core, SuperH, SPARC, x86, Xtensa, and so on |
Some Linux distributions (see previous table) are certified as being POSIX compliant. This does not imply that every Linux distribution is POSIX compliant. Some tools and libraries may differ from the standard. For Pthreads, this may mean that the behavior is sometimes different between Linux distributions (different scheduler, and so on) as well as compared to other OS's implementing Pthreads. |
|
MINIX 3 |
IA-32, ARM |
Conforms to POSIX specification standard 3 (SUSv3, 2004). |
|
NetBSD |
Alpha, ARM, PA-RISC, 68k, MIPS, PowerPC, SH3, SPARC, RISC-V, VAX, x86, and so on |
Almost fully compatible with POSX.1 (1990), and mostly compliant with POSIX.2 (1992). |
|
Nuclear RTOS |
ARM, MIPS, PowerPC, Nios II, MicroBlaze, SuperH, and so on |
Proprietary RTOS from Mentor Graphics aimed at embedded applications. |
|
NuttX |
ARM, AVR, AVR32, HCS12, SuperH, Z80, and so on |
Light-weight RTOS, scalable from 8 to 32-bit systems with strong focus on POSIX compliance. |
|
OpenBSD |
Alpha, x86_64, ARM, PA-RISC, IA-32, MIPS, PowerPC, SPARC, and so on |
Forked from NetBSD in 1995. Similar POSIX support. |
|
OpenSolaris/illumos |
IA-32, x86_64, SPARC, ARM |
Compliant with the commercial Solaris releases being certified compatible. |
|
VxWorks |
ARM, SH-4, x86, x86_64, MIPS, PowerPC |
POSIX compliant, with certification for user-mode execution environment. |
From this it should be obvious that it's not a clear matter of following the POSIX specification, and being able to count on one's code compiling on each of these platforms. Each platform will also have its own set of extensions to the standard for features which were omitted in the standard, but are still desirable. Pthreads are, however, widely used by Linux, BSD, and similar software.