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

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. 

主站蜘蛛池模板: 保康县| 古丈县| 绍兴市| 舒兰市| 达日县| 台湾省| 民和| 许昌市| 太保市| 开平市| 北辰区| 莱州市| 英德市| 石柱| 卢氏县| 大兴区| 远安县| 湾仔区| 鹿邑县| 静海县| 延庆县| 昌黎县| 乌审旗| 丹棱县| 平谷区| 多伦县| 阜阳市| 富民县| 堆龙德庆县| 会同县| 吉首市| 樟树市| 汝南县| 平度市| 六安市| 东台市| 中阳县| 镇安县| 东城区| 福贡县| 彰武县|