zhengJade commented on code in PR #2819:
URL: https://github.com/apache/brpc/pull/2819#discussion_r2043383387


##########
src/bthread/task_control.cpp:
##########
@@ -430,6 +435,11 @@ int TaskControl::_destroy_group(TaskGroup* g) {
 
 bool TaskControl::steal_task(bthread_t* tid, size_t* seed, size_t offset) {
     auto tag = tls_task_group->tag();
+
+    if (_priority_qs[tag].steal(tid)) {

Review Comment:
   同一个 tag 下的 worker 肯定会存在竞争的,这个应该算是预期之内,性能损失量级跟下文的 g->_rq.steal(tid) 相当,原来 
steal 的竞争产生的损失约为 N * M(N 为 tag 数量,常数级,M 为 g->_rq.steal(tid)  单次时间),现在为 (N + 1) 
* M



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to