tqchen commented on a change in pull request #4344: [ThreadPool] Solve thread 
transitions issue
URL: https://github.com/apache/incubator-tvm/pull/4344#discussion_r348097761
 
 

 ##########
 File path: src/runtime/threading_backend.cc
 ##########
 @@ -134,21 +134,28 @@ class ThreadGroup::Impl {
 #endif
     }
     if (exclude_worker0) {  // bind the master thread to core 0
-      cpu_set_t cpuset;
-      CPU_ZERO(&cpuset);
       if (reverse) {
-        CPU_SET(sorted_order_[sorted_order_.size() - 1], &cpuset);
+        core0_id_ = sorted_order_[sorted_order_.size() - 1];
       } else {
-        CPU_SET(sorted_order_[0], &cpuset);
+        core0_id_ = sorted_order_[0];
       }
+     pthread_atfork(nullptr, nullptr, 
ThreadGroup::Impl::BindMasterThreadToCore0);
 
 Review comment:
   This function may not be available under android. let us only do it under 
linux

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to