zhangqiongyu commented on PR #2962: URL: https://github.com/apache/brpc/pull/2962#issuecomment-2857293112
> 我最近看block_pool这块代码有点疑问,分配内存是加的bucket锁,如果没有内存就extend一个region,这个过程只持有一个bucket的锁,把这个region按照bucket划分后赋值给idle_list的过程没有加每个bucket的锁,会产生并发的问题,另外新的bucket赋值给idle_list会把原来的idle_list链破坏。 @wwbmmm @zhangqiongyu 你们看是否有这样的问题呢? 这里确实感觉有这个问题,不过目前我使用过程中没有触发,看了下原因: 1.我们只用了一个bucket,所以一个锁够了 2.为了减少运行时的内存动态申请,预估业务量后,通过gflag的入参,将region数量固定为1,pool_size等也都做了线上统计和预估,使用过程中基本不会触发扩容 idle_list应该是append到原来的tail上更加合理,但是也可能会越来越长,还需要引入相应的汰换策略? -- 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