chenBright commented on issue #2726: URL: https://github.com/apache/brpc/issues/2726#issuecomment-2272722270
主要是通过__dl_sym来hook,避免_dlerror_run申请内存导致malloc库死锁。不需要NO_PTHREAD_MUTEX_HOOK宏应该也是没问题的了。NO_PTHREAD_MUTEX_HOOK跟这个issue关系不大,主要解决没法调整动态库加载顺序导致找不到pthread_mutex_*符号的问题。 > 对于brpc中,为什么要去hack pthread中的mutex相关符号呢 hook pthread mutex是为了支持contention profiler和[worker潜在死锁问题的检测](https://github.com/apache/brpc/pull/2692)。 > 那是不是当我设置NO_PTHREAD_MUTEX_HOOK时,对pthread mutex的操作,可能会更快? 没开contention profiler的情况下,只是多了一个判断和线程局部变量加减,性能应该没有差别的。 -- 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: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org