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

Parallel Programming Library

Writing multithreaded code is considered to be one of the most difficult things in programming. Debugging multithreaded apps is even more difficult. When an operating system starts an app, it creates an operating process for it. In each process, there could be one or more threads running. Processors that power mobile devices typically have multiple cores. This means that there could be multiple threads executing in parallel on each core. A typical app executes in one thread, which runs on just one processor core. All other cores do nothing.

Since the very early versions of Delphi, there is a TThread class that represents the concept of the operating system thread. PPL provides the concept of TTask, which is more abstract than a thread and makes it easier to write multithreaded code. The very first thing to do in order to use PPL is to add a System.Threading unit to the uses clause of your program. Instead of creating threads directly, the library maintains on behalf of the app a self-tuning pool of threads that are used to execute tasks. Tasks can be easily synchronized. There are methods to wait for any or all tasks to complete.

主站蜘蛛池模板: 鄂尔多斯市| 德江县| 黑龙江省| 永胜县| 乌兰察布市| 龙川县| 开阳县| 中山市| 巴南区| 南康市| 阿勒泰市| 名山县| 射阳县| 吴旗县| 綦江县| 衡阳市| 集贤县| 富平县| 绵阳市| 乌恰县| 偃师市| 黔西| 邯郸市| 蓝山县| 宁晋县| 岳西县| 安宁市| 大石桥市| 南川市| 奇台县| 盖州市| 高淳县| 康定县| 金阳县| 中宁县| 德格县| 咸宁市| 吉水县| 昭平县| 巫山县| 怀集县|