TTask = class(TAbstractTask, TThreadPool.IThreadPoolWorkItem, ITask, TAbstractTask.IInternalTask)
class PASCALIMPLEMENTATION TTask : public TAbstractTask
TTask is a class managing and representing procedures that can be executed in parallel threads.
An instance of TTask represents a single task or unit of work to be done in a thread parallel to other running tasks, if possible.
The procedure associated with a task may run in parallel with those associated with other similar tasks and other threads currently running. What tasks will run in parallel and when they will run depend upon the threading resources available to the run-time environment of the target platform.
For tasks where a return value is needed at some later point in the program, the generic function, Future, can be used to launch the task to determine the needed value in parallel with other tasks; this value is then retrieved later where required by calling its GetValue method.
If tasks that may execute in parallel require globally available resources, variables, etc., use the synchronization tools of the System.SyncObjs unit to avoid possible contention issues.