yanghongchao

Results 26 comments of yanghongchao

@chenBright 帮忙看看?或者继续优化下?

类似go的 steal half是不是更好一些

若queue不长(可配),就别唤醒其他bthread_worker了,可以减少上下文切换。 epoll opt优化了很多上下文切换,应该还有优化空间。 ![Image](https://github.com/user-attachments/assets/d9fd4802-e0ba-420c-ae07-b43643c9268d) flamegraph_process_context-switches_130pthread: ![Image](https://github.com/user-attachments/assets/4c7c808f-c079-43e7-93db-e0c082c67335)

> > 类似go的 steal half是不是更好一些 > > steal 多个的时候,在流量不高的情况下,会造成同一个任务被两个 pthread 反复偷的情况,A 偷了 10 个,做到 一半,可能又被 B 偷回去了。而且由于任务的执行时间长短不同,一刀切的偷多个,可能导致 steal成本增加。 参考下这里https://github.com/golang/go/blob/go1.24.1/src/runtime/proc.go#L6983

> [#2819](https://github.com/apache/brpc/pull/2819) [#2916](https://github.com/apache/brpc/pull/2916) [#2907](https://github.com/apache/brpc/pull/2907) 这几个PR能改善这个问题了吗? 4.2号测了一次,也是这几个PR,效果没彻底解决;这几个PR可能有改动,我抽空再跑一次