huajsj commented on code in PR #11599:
URL: https://github.com/apache/tvm/pull/11599#discussion_r902997516
##########
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:
SetTid running in a worker thread, that means the execution order is random,
but currently logic assume it follow a order to execution and this would cause
logic issue.
we may need to figure out if there is any better and light weight solution.
--
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]