ehds commented on issue #1724: URL: https://github.com/apache/brpc/issues/1724#issuecomment-1884533170
这个得看你具体使用什么类型的锁,如果是pthread的锁,会阻塞当前运行的pthread,如果使用butex,那么不会阻塞当前pthread。发自我的 iPhone在 2024年1月8日,08:25,dxw1997 ***@***.***> 写道: 你比较的是bthread vs. ”pthread线程池“,还是bthread vs. “纯异步"? pthread线程池的代价是一旦阻塞只能阻塞pthread,影响并发度(也就是pthread线程的个数),后者代码难写。bthread就是平衡一下这两者。 还是有一点不懂。我现在在bthread中同步调用下游的一个服务,同步调用的时候调用端会阻塞在一个锁上,这时候在调用端bthread所跑的pthread上,会出现bthread的切换吗? —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***> -- 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]
