wwbmmm commented on PR #1774: URL: https://github.com/apache/incubator-brpc/pull/1774#issuecomment-1147009406
> if (ver1 == VersionOfSocketId(id)) 返回有效socket ptr > 改为 > if (ver1 == VersionOfSocketId(id) && !m->_recycle_flag) 才返回有效socket ptr Address是hot path,加了影响性能。而ReleaseAddtionalReference和Revive相对没有那么hot (除非是短连接),加锁影响小一些。 还有一种解决方案是让recycle_flag有3个值:正常、Revive中、已释放。如果ReleaseAddtionalReference发现状态是“Revive中”就sched_yield一下,直到遇到其它两个状态再继续。因为这种情况发生概率很小,这么改对性能几乎不会有影响。 -- 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]
