MrGuin commented on PR #1751:
URL: https://github.com/apache/brpc/pull/1751#issuecomment-1853427709

   现在我这里每次 butex_wake 后主动调 bthread_flush 解决了不能及时调度的问题。
   我看了下上下文,感觉当前的 no_signal 的实现针对场景是消费者 bthread 批量 butex_wake,然后再一次 
bthread_flush,no_signal 参数不希望被调度,顺带也不会把当前 bthread 给 exchange 过去。但如果消费者无法批量去 
butex_wake 最后统一 flush 的话,就只能传 no_signal 参数然后手动去 bthread_flush 了。
   比如我们是 braft 状态机 on_apply 线程,每次修改状态机然后唤醒等待在 butex 上的 RPC线程,因为每个 raft group 的 
on_apply 是严格串行的,是性能瓶颈,所以我们不希望它在唤醒别人的时候被切走,所以传了 no_signal,但被唤醒的 RPC bthread 
也是要及时调度执行的,不然会影响 RPC 服务的 responsiveness。如果只是要达到不让当前调用 butex_wake 的线程被 exchange 
走的效果,只能 no_signal 然后 bthread_flush,感觉不够优雅。
   @wwbmmm 佬怎么看呢?


-- 
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]

Reply via email to