Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ CStatus GDynamicEngine::setup(const GSortedGElementPtrSet& elements) {
* 3. 计算element的结构类型
* 4. 分析当前dag类型信息
*/
CGRAPH_ASSERT_NOT_NULL(thread_pool_);
CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION(!GEngine::isDag(elements),
"it is not a dag struct");
mark(elements);
Expand Down Expand Up @@ -67,6 +68,7 @@ CVoid GDynamicEngine::mark(const GSortedGElementPtrSet& elements) {
total_element_arr_.clear();
front_element_arr_.clear();
total_end_size_ = 0;
wait_busy_epoch_ = thread_pool_->getConfig().pipeline_wait_busy_epoch_;

for (GElementPtr element : elements) {
if (element->run_before_.empty()) {
Expand Down Expand Up @@ -316,7 +318,7 @@ CVoid GDynamicEngine::prepareRun() {

template<typename Pred>
CBool GDynamicEngine::isFastFinished(Pred&& check) {
auto epoch = thread_pool_->getConfig().pipeline_wait_busy_epoch_;
auto epoch = wait_busy_epoch_;
while (epoch-- > 0 && !check()) {
CGRAPH_YIELD();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class GDynamicEngine : public GEngine {
std::atomic<CSize> parallel_run_num_ {0}; // 纯并行时,执行的个数信息
GElementPtrMat2D parallel_element_matrix_ {}; // 纯并行时,记录分解后的数据
internal::GEngineDagType dag_type_ = { internal::GEngineDagType::COMMON }; // 当前元素的排布形式
CInt wait_busy_epoch_ {0}; // dag执行结束前,轮询等待的次数

UCvMutex locker_;
std::mutex status_lock_;
Expand Down
Loading