提交 93f4977c 编写于 作者: M Megvii Engine Team

feat(mge/imperative): add thread name

GitOrigin-RevId: 61eece55b8f4008882532fa4b50a94f1164efee4
上级 98a74e4a
......@@ -69,6 +69,10 @@ class PyTaskDipatcher {
pybind11::gil_scoped_acquire _;
f();
}
void on_async_queue_worker_thread_start() override {
mgb::sys::set_thread_name("py_task_worker");
}
};
Queue queue;
bool finalized = false;
......
......@@ -143,10 +143,15 @@ private:
size_t m_enable_evict = 0;
struct WorkQueue : AsyncQueueSC<Command, WorkQueue> {
WorkQueue(ChannelImpl* owner) : m_owner(owner) {}
WorkQueue(ChannelImpl* owner) : m_owner(owner) {
sys::set_thread_name("interpreter");
}
void process_one_task(Command& cmd) {
m_owner->process_one_task(cmd);
}
void on_async_queue_worker_thread_start() override {
sys::set_thread_name("worker");
}
private:
ChannelImpl* m_owner;
} m_worker;
......
......@@ -44,6 +44,9 @@ class AsyncReleaser : public CompNodeDepedentObject {
std::this_thread::sleep_for(1us);
add_task(std::move(param));
}
void on_async_queue_worker_thread_start() override {
sys::set_thread_name("releaser");
}
};
Waiter m_waiter{this};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册