System.Threading.TParallel.Join

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function Join(Sender: TObject; AEvents: array of TNotifyEvent): ITask; overload; static;
class function Join(Sender: TObject; AEvents: array of TNotifyEvent; APool: TThreadPool): ITask; overload; static;
class function Join(Sender: TObject; AEvent1, AEvent2: TNotifyEvent): ITask; overload; static; inline;
class function Join(Sender: TObject; AEvent1, AEvent2: TNotifyEvent; APool: TThreadPool): ITask; overload; static;
class function Join(const AProcs: array of TProc): ITask; overload; static;
class function Join(const AProcs: array of TProc; APool: TThreadPool): ITask; overload; static;
class function Join(const AProc1, AProc2: TProc): ITask; overload; static; inline;
class function Join(const AProc1, AProc2: TProc; APool: TThreadPool): ITask; overload; static;

C++

static _di_ITask __fastcall Join(System::TObject* Sender, System::Classes::TNotifyEvent *AEvents, const int AEvents_High)/* overload */;
static _di_ITask __fastcall Join(System::TObject* Sender, System::Classes::TNotifyEvent *AEvents, const int AEvents_High, TThreadPool* APool)/* overload */;
static _di_ITask __fastcall Join(System::TObject* Sender, System::Classes::TNotifyEvent AEvent1, System::Classes::TNotifyEvent AEvent2)/* overload */;
static _di_ITask __fastcall Join(System::TObject* Sender, System::Classes::TNotifyEvent AEvent1, System::Classes::TNotifyEvent AEvent2, TThreadPool* APool)/* overload */;
static _di_ITask __fastcall Join(const System::Sysutils::_di_TProc *AProcs, const int AProcs_High)/* overload */;
static _di_ITask __fastcall Join(const System::Sysutils::_di_TProc *AProcs, const int AProcs_High, TThreadPool* APool)/* overload */;
static _di_ITask __fastcall Join(const System::Sysutils::_di_TProc AProc1, const System::Sysutils::_di_TProc AProc2)/* overload */;
static _di_ITask __fastcall Join(const System::Sysutils::_di_TProc AProc1, const System::Sysutils::_di_TProc AProc2, TThreadPool* APool)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Threading.pas
System.Threading.hpp
System.Threading TParallel

Description

TParallel.Join groups together procedures such that each can be executed in parallel threads.

Whether two or more procedures given to TParallel.Join will run in parallel threads depends on available threading resources.

Each overload of TParallel.Join offers different functionality and information depending on the particular parameter list.

All overloads of TParallel.Join return an interface instance of type ITask whose Status property is available to determine when procedures involved with TParallel.Join have been completed, are still running, failed to complete, etc.

When the overload of TParallel.Join has a Sender parameter, the caller passes an object that is sent to the instances of TNotifyEvent when executed as is done with other event handlers in RAD Studio. The overloads of TParallel.Join not involving a Sender parameter execute procedures conforming to the TProc type, that is, represent procedures without parameters nor return values.

When APool parameter of type TThreadPool is specified, the program author controls the thread resources available to the iterated events of TParallel.Join through the use of its TThreadPool.SetMinWorkerThreads and TThreadPool.SetMaxWorkerThreads methods. Be advised when calling these methods that too many simultaneous threads can generate overhead that diminishes or eliminates the efficiency benefit of executing routines in parallel.

See also