huajsj commented on code in PR #11599:
URL: https://github.com/apache/tvm/pull/11599#discussion_r905729047


##########
src/runtime/threading_backend.cc:
##########
@@ -101,13 +109,19 @@ class QuRTThread {
 };
 #endif  // __hexagon__
 thread_local int max_concurrency = 0;
+
 class ThreadGroup::Impl {
  public:
   Impl(int num_workers, std::function<void(int)> worker_callback, bool 
exclude_worker0)
       : num_workers_(num_workers) {
     ICHECK_GE(num_workers, 1) << "Requested a non-positive number of worker 
threads.";
     for (int i = exclude_worker0; i < num_workers_; ++i) {
-      threads_.emplace_back([worker_callback, i] { worker_callback(i); });
+      threads_.emplace_back([worker_callback, i, this] {
+#ifndef __hexagon__
+        SetTid();

Review Comment:
   How the "yield" can help  disorder issue in threads_tid_ ? there are two 
issue in this solution #1 threads_tid_[i] invalid, #2 threads_tid_[i] is not 
the tid of i thread(disorder issue). the line 112 problem is #2.



-- 
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