MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看最新英文版本。
取消所有作业或任务
自 R2022a 起
cancelAll(p.FevalQueue)
cancelAll(p.FevalQueue) 停止指定池中所有排队或正在运行的元素。
p.FevalQueue
示例
全部折叠
创建一个并行池。
pool = parpool;
Starting parallel pool (parpool) using the 'Processes' profile ... Connected to the parallel pool (number of workers: 6).
使用 parfeval 运行 pause(Inf) 而不检索任何输出。
parfeval
pause(Inf)
f = parfeval(pool,@pause,0,Inf);
检查池中排队和运行的函数的状态。
pool.FevalQueue
ans = FevalQueue with properties: QueuedFutures: [0x0 parallel.FevalFuture] RunningFutures: [1x1 parallel.FevalFuture]
使用 cancelAll 来停止 Futures 中的所有 FevalQueue。
cancelAll
Futures
FevalQueue
cancelAll(pool.FevalQueue) pool.FevalQueue
ans = FevalQueue with properties: QueuedFutures: [0x0 parallel.FevalFuture] RunningFutures: [0x0 parallel.FevalFuture]
FevalFuture
要在后台池上运行的 FevalFuture 对象队列,指定为 FevalFuture 标量和 FevalFuture 数组。
全部展开
backgroundPool
ThreadPool
该函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
在 R2022a 中推出
parfeval | cancel | delete
cancel
delete
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处