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

feat(mge/imperative): add thread name

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