You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/06/10 02:27:46 UTC
[GitHub] [tvm] sunjiweiswift commented on a diff in pull request #11448: [Runtime][Thread pool]
sunjiweiswift commented on code in PR #11448:
URL: https://github.com/apache/tvm/pull/11448#discussion_r894103170
##########
src/runtime/thread_pool.cc:
##########
@@ -116,9 +115,16 @@ class ParallelLauncher {
num_pending_.fetch_sub(1);
par_errors_[task_id] = TVMGetLastError();
has_error_.store(true);
+ std::unique_lock<std::mutex> lock(finish_mutex_);
+ finish_cv_.notify_all();
}
// Signal that one job has finished.
- void SignalJobFinish() { num_pending_.fetch_sub(1); }
+ void SignalJobFinish() {
+ if (num_pending_.fetch_sub(1) <= 1) {
Review Comment:
atomic waitis a cleaner solution, but need c++20. Not very friendly to users who have alerady use TVM Runtime, Need update C++ compiler.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org