chenBright commented on issue #2209: URL: https://github.com/apache/brpc/issues/2209#issuecomment-1511518196
改成协程锁不太合适。thread local的线程锁是为了让不同线程之间的读无竞争的。如果换成了协程锁,某些情况下,对于同一个thread local的协程锁,会一直有竞争。例如,lb中使用了协程锁的实现,在更新实例信息时,读协程会被挂起,读协程被唤醒时可能被调度到其他worker线程。如果这些读协程比较多,则会跟后续的读协程形成竞争,导致后续的读协程被挂起,从而调度到其他worker线程。这个场景下,可能竞争就会一直存在了。所以使用线程锁比较合适吧。 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
