Using the Parallel Programming Library
The RTL provides the Parallel Programming Library (PPL), giving your applications the ability to have tasks running in parallel taking advantage of working across multiple CPU devices and computers. The PPL includes a number of advanced features for running tasks, joining tasks, waiting on groups of tasks, etc. to process. For all this, there is a thread pool that self tunes itself automatically (based on the load on the CPU’s) so you do not have to care about creating or managing threads for this purpose.
You can use this library by including System.Threading in your apps. This unit is made up of several features that can be included into new and existing projects. The unit also includes a number of overloaded arguments to make it suitable for C++ as well as Object Pascal.
Using the PPL, your applications can easily:
- Make looping faster with TParallel.For.
- Run multiple tasks in parallel using TTask and ITask.
- Leave a process running focusing on other tasks and then get the result of that process at the point you want. IFuture allows you to establish a priority for the running code blocks and still return the results when needed.
The PPL works on Windows, MacOSX, Android, and iOS devices.
- Using TTask from the Parallel Programming Library
- Using TParallel.For from the Parallel Programming Library
- Using TTask.IFuture from the Parallel Programming Library