提交 f3e983e4 编写于 作者: Y Yu Yang

Memory order

上级 36e04152
......@@ -702,7 +702,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
while (!pending_ops.empty()) {
VarHandleBase *ready_var = nullptr;
for (auto &pair : pending_vars) {
if (pair.second) {
if (pair.second.load(std::memory_order_acquire)) {
ready_var = pair.first;
}
}
......@@ -714,7 +714,6 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
throw * member_->exception_;
}
std::this_thread::yield();
continue;
}
......@@ -753,7 +752,7 @@ void ParallelExecutor::RunOp(
VLOG(10) << op->DebugString();
op->Run();
for (auto *ready : ready_buffer) {
*ready = true;
ready->store(true, std::memory_order_release);
}
} catch (platform::EnforceNotMet ex) {
member_->exception_.reset(new platform::EnforceNotMet(ex));
......@@ -762,8 +761,7 @@ void ParallelExecutor::RunOp(
}
};
op_run();
// member_->pool_.enqueue(op_run);
member_->pool_.enqueue(op_run);
}
} // namespace framework
} // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册