yanglimingcn commented on code in PR #2358: URL: https://github.com/apache/brpc/pull/2358#discussion_r1366421976
########## src/bthread/bthread.cpp: ########## @@ -306,8 +345,14 @@ int bthread_setconcurrency(int num) { } if (num > bthread::FLAGS_bthread_concurrency) { // Create more workers if needed. - bthread::FLAGS_bthread_concurrency += - c->add_workers(num - bthread::FLAGS_bthread_concurrency); + auto tag = bthread::FLAGS_bthread_tag_to_set; + auto add = num - bthread::FLAGS_bthread_concurrency; + if (tag == BTHREAD_TAG_INVALID) { + add = bthread::add_workers_for_each_tag(add); Review Comment: 这块有点纠结,感觉一个gflags没法操作某个tag的数量,bthread_setconcurrency(int num, bthread_tag_t tag)这个函数也是希望能用gflags来控制吧。 ########## src/bthread/bthread.cpp: ########## @@ -306,8 +345,14 @@ int bthread_setconcurrency(int num) { } if (num > bthread::FLAGS_bthread_concurrency) { // Create more workers if needed. - bthread::FLAGS_bthread_concurrency += - c->add_workers(num - bthread::FLAGS_bthread_concurrency); + auto tag = bthread::FLAGS_bthread_tag_to_set; + auto add = num - bthread::FLAGS_bthread_concurrency; + if (tag == BTHREAD_TAG_INVALID) { + add = bthread::add_workers_for_each_tag(add); Review Comment: 这块有点纠结,感觉一个gflags没法操作某个tag的数量,bthread_setconcurrency(int num, bthread_tag_t tag)这个函数也是希望能用gflags来控制吧。 -- 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