File tree Expand file tree Collapse file tree
src/GraphCtrl/GraphElement/_GEngine/GDynamicEngine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ CStatus GDynamicEngine::setup(const GSortedGElementPtrSet& elements) {
1818 * 3. 计算element的结构类型
1919 * 4. 分析当前dag类型信息
2020 */
21+ CGRAPH_ASSERT_NOT_NULL (thread_pool_);
2122 CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (!GEngine::isDag (elements),
2223 " it is not a dag struct" );
2324 mark (elements);
@@ -67,6 +68,7 @@ CVoid GDynamicEngine::mark(const GSortedGElementPtrSet& elements) {
6768 total_element_arr_.clear ();
6869 front_element_arr_.clear ();
6970 total_end_size_ = 0 ;
71+ wait_busy_epoch_ = thread_pool_->getConfig ().pipeline_wait_busy_epoch_ ;
7072
7173 for (GElementPtr element : elements) {
7274 if (element->run_before_ .empty ()) {
@@ -316,7 +318,7 @@ CVoid GDynamicEngine::prepareRun() {
316318
317319template <typename Pred>
318320CBool GDynamicEngine::isFastFinished (Pred&& check) {
319- auto epoch = thread_pool_-> getConfig (). pipeline_wait_busy_epoch_ ;
321+ auto epoch = wait_busy_epoch_ ;
320322 while (epoch-- > 0 && !check ()) {
321323 CGRAPH_YIELD ();
322324 }
Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ class GDynamicEngine : public GEngine {
126126 std::atomic<CSize> parallel_run_num_ {0 }; // 纯并行时,执行的个数信息
127127 GElementPtrMat2D parallel_element_matrix_ {}; // 纯并行时,记录分解后的数据
128128 internal::GEngineDagType dag_type_ = { internal::GEngineDagType::COMMON }; // 当前元素的排布形式
129+ CInt wait_busy_epoch_ {0 }; // dag执行结束前,轮询等待的次数
129130
130131 UCvMutex locker_;
131132 std::mutex status_lock_;
You can’t perform that action at this time.
0 commit comments