mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
enhance: Set thread name for segcore thread pool (#42017)
Thread name could be helpful when debugging thread explosion issues Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
c937da5234
commit
9fb0257bfa
@ -15,6 +15,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "ThreadPool.h"
|
#include "ThreadPool.h"
|
||||||
|
#include "log/Log.h"
|
||||||
|
|
||||||
namespace milvus {
|
namespace milvus {
|
||||||
|
|
||||||
@ -65,6 +66,7 @@ void
|
|||||||
ThreadPool::Worker() {
|
ThreadPool::Worker() {
|
||||||
std::function<void()> func;
|
std::function<void()> func;
|
||||||
bool dequeue;
|
bool dequeue;
|
||||||
|
SetThreadName(name_);
|
||||||
while (!shutdown_) {
|
while (!shutdown_) {
|
||||||
std::unique_lock<std::mutex> lock(mutex_);
|
std::unique_lock<std::mutex> lock(mutex_);
|
||||||
idle_threads_size_++;
|
idle_threads_size_++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user