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

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. 

主站蜘蛛池模板: 临武县| 南开区| 泰安市| 新和县| 福鼎市| 余干县| 屏南县| 行唐县| 望谟县| 宜丰县| 阳原县| 襄汾县| 工布江达县| 龙泉市| 手游| 什邡市| 武冈市| 岫岩| 随州市| 乌海市| 娄底市| 灌南县| 黄平县| 巩留县| 界首市| 同心县| 虎林市| 通山县| 辉县市| 法库县| 宣城市| 长沙县| 安西县| 容城县| 拜城县| 峨眉山市| 酉阳| 寻甸| 北京市| 雷山县| 兴国县|