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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to