MJY-HUST commented on PR #2645:
URL: https://github.com/apache/brpc/pull/2645#issuecomment-2161206047

   > 对这个场景有点疑问,如果bthread生命周期很短,为什么还要使用bthread_local变量呢,用pthread 
local、局部变量或者通过函数参数传递不行吗
   
   场景是:使用brpc框架通信,server下面接着一个数据库。使用bthread 
pool用于处理数据库的查询请求,数据库内部的实现使用了bthread级别的锁和tls来避免阻塞线程。数据库内部需要使用一些thread_local(bthread_local)来保证其一致性。
   
并不是所有的条件下bthread的生命周期都会很短,但是在一些场景下,如果数据都在缓存中,那么一个bthread的生命周期就会很短,此时单链表结构的keytable
 pool管理模式就会出现瓶颈。


-- 
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

Reply via email to