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

Threading

Threads provide a system programmer with a means to perform parallel execution. Specifically, a thread is a unit of execution that the operating system schedules when it deems appropriate. Both C++ and POSIX provide APIs for working with threads, with the C++ APIs arguably being easier to work with.

It should be noted that, under the hood, C++ leverages the POSIX threads library (pthreads)so, even though C++ provides a set of APIs for working with threads, in the end, POSIX threads are responsible for threading in all cases. 

The reason for this is simple. POSIX defines the interface a program leverages to talk to the operating system. In this case, if you wish to tell the operating system to create a thread, you must do so by leveraging the APIs defined by the operating system. If the operating system is POSIX-compliant, those interfaces are POSIX, regardless of any abstractions that might be put in place to make working with the APIs easier. 

主站蜘蛛池模板: 肥东县| 三台县| 托克逊县| 额尔古纳市| 浪卡子县| 如东县| 香河县| 丹阳市| 乐陵市| 仁寿县| 修文县| 东明县| 吉水县| 额敏县| 福海县| 信宜市| 凤阳县| 图木舒克市| 景泰县| 永福县| 甘洛县| 镇赉县| 德化县| 耿马| 丁青县| 平武县| 淮安市| 茌平县| 贵南县| 绵竹市| 三河市| 五莲县| 西畴县| 双桥区| 怀宁县| 洪泽县| 连南| 家居| 东宁县| 眉山市| 龙门县|