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


##########
src/runtime/threading_backend.cc:
##########
@@ -220,7 +235,7 @@ class ThreadGroup::Impl {
             } else {
               core_id = sorted_order_[i + exclude_worker0];
             }
-            SetThreadAffinity(threads_[i].native_handle(), {core_id});
+            SetThreadAffinity(threads_[i].native_handle(), threads_tid_[i], 
{core_id});

Review Comment:
   This part seems like have a timing issue, threads_tid_ share by main thread 
and worker threads, current logic not guarantee that the threads_tid_[i] is 
valid when main thread to read it. I think we should can reproduce such issue 
by adding a debug "sleep" between line 118 and line 119
   



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