MJY-HUST commented on code in PR #2819:
URL: https://github.com/apache/brpc/pull/2819#discussion_r1906923179


##########
src/bthread/parking_lot.h:
##########
@@ -30,6 +30,7 @@ namespace bthread {
 // Park idle workers.
 class BAIDU_CACHELINE_ALIGNMENT ParkingLot {
 public:
+    static butil::atomic<int> _waiting_count;

Review Comment:
   这里 `_waiting_count` 作为全局静态变量感觉不能有效减少 signal 的次数,因为即使在 `_waiting_count ` != 0 
的场景,仍然存在parking_lot list中有的pl存在waiting thread,有的pl不存在。在 signal_task 
中是先随机选择一个pl来signal,选择的 pl 不一定存在 waiting thread。



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