官术网_书友最值得收藏!

POSIX threads

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:

 

Other operating systems are mostly compliant. The following are examples of the same:

 

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.

主站蜘蛛池模板: 东乌珠穆沁旗| 庆元县| 抚远县| 肥乡县| 三台县| 曲沃县| 姚安县| 奎屯市| 沙湾县| 阆中市| 怀集县| 察雅县| 左权县| 西乡县| 东宁县| 河西区| 枣庄市| 新巴尔虎右旗| 措勤县| 仙游县| 沙湾县| 巩义市| 华亭县| 荣昌县| 黔南| 高要市| 蚌埠市| 黔西县| 武义县| 雅安市| 克什克腾旗| 温泉县| 元朗区| 红桥区| 夏河县| 桂林市| 永昌县| 陆良县| 始兴县| 息烽县| 罗甸县|