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

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. 

主站蜘蛛池模板: 铁力市| 盐亭县| 东安县| 丹寨县| 交口县| 西丰县| 新巴尔虎左旗| 阳东县| 揭东县| 泗洪县| 屯留县| 吴忠市| 泸水县| 聊城市| 凤山市| 金沙县| 依兰县| 灵武市| 藁城市| 夏河县| 上林县| 庄浪县| 佳木斯市| 卢龙县| 沂源县| 普安县| 陇西县| 永吉县| 易门县| 梅河口市| 罗定市| 会同县| 建始县| 海城市| 杨浦区| 天台县| 鹰潭市| 汉寿县| 雅江县| 沧源| 和田县|