zcfh commented on PR #2918: URL: https://github.com/apache/brpc/pull/2918#issuecomment-2732058034
> 为什么不使用 BAIDU_GET_VOLATILE_THREAD_LOCAL 宏的方式? 这里我的考虑是,使用 BAIDU_GET_VOLATILE_THREAD_LOCAL 的方式,在非LTO模式下,多了一次函数调用。 只要让它在LTO模式下不inline,那编译器就不会去做优化,**这样改动更小些**。其他地方因为在一个函数内,会多次访问tls_task_group,所以才需要 BAIDU_GET_VOLATILE_THREAD_LOCAL。 当然,这只是我的考量,如果你们更建议以 BAIDU_GET_VOLATILE_THREAD_LOCAL 的方式,那就还是用 BAIDU_GET_VOLATILE_THREAD_LOCAL。 -- 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