guangpec1 opened a new issue #1038: task control 中所有的 local queue is full 
导致死锁&解决方案.
URL: https://github.com/apache/incubator-brpc/issues/1038
 
 
   问题:
   当请求量过大时,所有的local queue 都是 full 的状态,就会执行pthread 的 usleep,这样会导致死锁(这个问题以前有人提过).
   ====task_group_inl.h 代码如下=====
       while (!_rq.push(tid)) {
           flush_nosignal_tasks();
           ::usleep(1000);
       }
   方案
   如果local queue 是full 的状态,当前线程直接执行,不放到队列中. 既不进行 usleep.
   伪代码如下:
       while (!_rq.push(tid)) {
           // 替换 usleep, push tid 失败,直接执行tid(不经过队列,直接切换栈)
           TaskGroup::exchange( current_group , tid)
       }
   @jamesge 有时间帮忙,看一下这个方案是否有问题? 多谢.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to