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

  • Expert Delphi
  • Pawe? G?owacki
  • 199字
  • 2021-07-02 20:44:25

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.

主站蜘蛛池模板: 嘉祥县| 湟中县| 桑植县| 赫章县| 玉龙| 长治市| 和政县| 济阳县| 鄯善县| 丹江口市| 上饶县| 法库县| 台州市| 涟源市| 翼城县| 白玉县| 三门峡市| 阿图什市| 且末县| 雅安市| 文安县| 温宿县| 墨脱县| 荥经县| 车致| 山阴县| 横山县| 雅江县| 嘉祥县| 五原县| 呼玛县| 张家口市| 碌曲县| 任丘市| 太保市| 农安县| 虹口区| 四会市| 当阳市| 乐都县| 沙洋县|