System.Threading.TParallel.Join

提供: RAD Studio API Documentation
移動先: 案内検索

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 */;

プロパティ

種類 可視性 ソース ユニット
function public
System.Threading.pas
System.Threading.hpp
System.Threading TParallel


説明

TParallel.Join は、手続きをグループにまとめて、それぞれを並列のスレッドで実行できるようにします。

TParallel.Join に渡された複数の手続きが並列スレッドで実行されるかどうかは、使用可能なスレッド処理リソースに応じて決まります。

TParallel.Join のそれぞれのオーバーロード メソッドは、パラメータ リストに応じて機能や情報が異なります。

TParallel.Join のオーバーロード メソッドはすべて、ITask 型のインターフェイス インスタンスを返します。その Status プロパティによって、TParallel.Join に関連付けられた手続きが完了したか、まだ実行中か、完了できず失敗したかを判断することができます。

TParallel.Join のオーバーロード メソッドに Sender パラメータが含まれる場合、呼び出し側から渡したオブジェクトは実行時に TNotifyEvent のインスタンスに送られます。これは RAD Studio の他のイベント ハンドラの場合と同じです。Sender パラメータのない TParallel.Join のオーバーロード メソッドは、TProc 型に一致する手続き(パラメータも戻り値もない手続き)を実行します。

TThreadPool 型の APool パラメータが指定されていると、その TThreadPool.SetMinWorkerThreads メソッドと TThreadPool.SetMaxWorkerThreads メソッドを使用して、TParallel.Join の反復イベントで利用できるスレッド リソースをプログラム側で制御できます。ただし、これらのメソッドを呼び出すときには、同時に実行するスレッド数が多すぎるとオーバーヘッドが生じて、ルーチンを並列で実行する効率面のメリットが減ったりなくなるため、注意が必要です。

関連項目