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

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.

主站蜘蛛池模板: 兰坪| 汽车| 宝鸡市| 新竹县| 大埔区| 绵竹市| 随州市| 香港 | 连山| 五莲县| 南江县| 盘锦市| 潮安县| 吴忠市| 进贤县| 曲靖市| 遂昌县| 壤塘县| 襄汾县| 峡江县| 商洛市| 正定县| 胶南市| 昌都县| 彰化市| 封丘县| 商丘市| 陕西省| 微博| 仙居县| 安庆市| 泰安市| 浮梁县| 白山市| 涿州市| 霍林郭勒市| 临海市| 新巴尔虎右旗| 民县| 东乌珠穆沁旗| 武鸣县|