简体   繁体   English

如何等待PooledThreadExecutor完成?

[英]How to wait for PooledThreadExecutor to finish?

Regarding the AWS c++ sdk thread pool feature, is there an elegant way to wait for PooledThreadExecutor to finish all tasks in the queue after calling -for example- getObjectAsync many times ? 关于AWS c ++ sdk线程池功能,是否存在一种优雅的方法来等待PooledThreadExecutor在多次调用-例如-getObjectAsync之后完成队列中的所有任务?

Or should I just use getObjectCallable, store references to all future objects in an array, loop the array and wait for each one. 或者我应该只使用getObjectCallable,将对所有未来对象的引用存储在一个数组中,循环该数组并等待每个对象。

The destructor of the PooledThreadExecutor will join its threads. PooledThreadExecutor的析构函数将加入其线程。 Effectively as if you would have used the Callable version and waited till the request returned before exiting. 就像您将使用Callable版本一样,并一直等到请求返回后才退出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM