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

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.

主站蜘蛛池模板: 米泉市| 六盘水市| 民乐县| 甘肃省| 武宣县| 桐庐县| 灵石县| 合山市| 微博| 崇义县| 红原县| 克拉玛依市| 望城县| 安康市| 万全县| 阿城市| 渑池县| 自治县| 五寨县| 正定县| 陵水| 尉犁县| 壤塘县| 垫江县| 潜江市| 定边县| 东兰县| 台湾省| 凤庆县| 新丰县| 乐安县| 洞口县| 新平| 丹江口市| 舒城县| 察哈| 稷山县| 冕宁县| 鸡西市| 芦山县| 金湖县|