chenBright commented on issue #2635:
URL: https://github.com/apache/brpc/issues/2635#issuecomment-2116511551

   > 第一次需要使用keytbale时构造,并赋值给task_meta.local_storage. 
keytable,task_meta析构时销毁keytable。
   
   
我理解这是为了尽量复用、减少构造、不加锁。TaskMeta是从ResourcePool分配出来的,在进程运行的时候,不会释放TaskMeta的吧。那么一旦使用了KeyTable,TaskMeta就会绑定一个KeyTable,跟bthread_keytable_pool_t机制是不是有点兼容?例如一个TaskMeta已经绑定一个KeyTable,但是bthread_attr_t设置bthread_keytable_pool_t,这时候还需要额外的状态来记录KeyTable的来源用于处理归还逻辑吧。
   
   是不是用ObjectPool来分配KeyTable就能规避锁的影响,实现还简单?


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