cancelAll
説明
cancelAll(
は、指定されたプール内でキューに入っているかまたは実行中の要素をすべて停止します。 p.FevalQueue
)
例
プールで実行中のすべての関数の停止
並列プールを作成します。
pool = parpool;
Starting parallel pool (parpool) using the 'Processes' profile ... Connected to the parallel pool (number of workers: 6).
parfeval
を使用して、出力を一切取得せずに pause(Inf)
を実行します。
f = parfeval(pool,@pause,0,Inf);
プール内でキューに入っている実行中の関数のステータスを確認します。
pool.FevalQueue
ans = FevalQueue with properties: QueuedFutures: [0x0 parallel.FevalFuture] RunningFutures: [1x1 parallel.FevalFuture]
cancelAll
を使用して FevalQueue
内のすべての Futures
を停止します。
cancelAll(pool.FevalQueue) pool.FevalQueue
ans = FevalQueue with properties: QueuedFutures: [0x0 parallel.FevalFuture] RunningFutures: [0x0 parallel.FevalFuture]
入力引数
p.FevalQueue
— バックグラウンド プールで実行する、FevalFuture
オブジェクトのキュー
FevalFuture
スカラー | FevalFuture
配列
バックグラウンド プールで実行する、FevalFuture
オブジェクトのキュー。FevalFuture
スカラーおよび FevalFuture
配列として指定します。
拡張機能
スレッドベースの環境
MATLAB® の backgroundPool
を使用してバックグラウンドでコードを実行するか、Parallel Computing Toolbox™ の ThreadPool
を使用してコードを高速化します。
この関数はスレッドベースの環境を完全にサポートします。詳細については、スレッドベースの環境での MATLAB 関数の実行を参照してください。
バージョン履歴
R2022a で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)