sunce4t commented on issue #3132:
URL: https://github.com/apache/brpc/issues/3132#issuecomment-3465981319

   > 把window拆成send window和recv window不就好了吗, 每次发送前比较这两者的最小值是否大于0, send 
wc则根据unsignaled的比例来更新send window, 你这样不是还加了几个锁和队列, 拆window只需要多做一次relaxed 
order的原子操作即可
   
   hi,加锁和队列是因为 
SendImm也会signaled,SendImm的触发时机不能保证,例如:可能当前有10个unsignaled,刚好触发一次SendImm   
所以我加了锁和队列记录每一次ibv_post_send前有多少个unsignaled请求
   
   最开始我们有尝试在处理send cqe的逻辑处按比例更新你提到的send window,后面发现不能确定每个send 
cqe前有多少个unsignaled的请求。
   
   拆成两个window确实更好,如果要精准更新send 
window,就得保证ibv_post_send的顺序跟记录unsignaled的顺序一致,这一部还得加锁吧。 不过这样只需要加一个锁、一个队列和一个原子变量。


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