chenBright commented on PR #2645: URL: https://github.com/apache/brpc/pull/2645#issuecomment-2121703973
> 我看ResourcePool获取对象的模式是如下图,那么reserve时初始化多个全局的block是否可行。 ResourcePool也是单例哦。 > return_keytable时,加读锁的临界区是判断destroyed + 将对象返回给pool,感觉不能直接使用原子变量 嗯嗯,return_keytable和bthread_keytable_pool_destroy需要互斥,不能用原子变量。 无论是ObjectPool还是ResourcePool的实现方式,即使destroyed=1,也是要将KeyTable返回给ObjectPool或者ResourcePool的吧。 -- 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