MR-workaholic opened a new issue #971: 关于BRPC设计的一些疑问 URL: https://github.com/apache/incubator-brpc/issues/971 **关于BRPC定时器设计的疑问** BRPC的定时线程是独立的线程,而执行定时回调函数是在独立线程就地马上执行的,请问可以将回调函数放在bthread上执行吗?若这么实现,有什么不妥麽? **起因** 我们在修改BRPC的代码时,在以为所有网络收发都是基于bthread的认知上,在socket层面加了阻塞协程的动作。但是实验发现,定时线程被堵塞了!原因是,出现连接超时时,定时器会直接在定时线程中直接执行重发任务,导致定时线程被堵塞了。 **思考** BRPC中有bthread的概念,但发现这种概念的引用似乎仅仅是存在于channel层面之上;在channel层面之下,如socket网络层面,还是运用异步+非阻塞的实现方法,没有采取bthread的思想去编码(代码中大量运用pthread mutex而非bthread mutex似乎就是一个印证)。 在修改channel层面下的代码时,我们不能采用bthread的思想编码了吗? 对于上面的疑问,可否将定时器的回调函数在bthread中执行?若这么做之后,我们是否就可以用bthread的思想修改channel层面之下的代码了?
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
