zhengJade commented on PR #2819:
URL: https://github.com/apache/brpc/pull/2819#issuecomment-2490597540

   > > 能否在bthread这个层面上,创建协程的时候设置一个属性,使它具有更高的优先级呢?现在这里专门设置了epoll_XXX,感觉有点特化。 
另外,总是让epoll的bthread优先调度的话,会不会造成堆积很多任务的情况呢?
   > 
   > 1 你说得对,是有点特化,这么改简单点
   > 
   > 如果是带优先级的bthread 可能就得改调度了,涉及到任务抢占/饥饿问题,可能麻烦一点
   > 
   > 2 你说的也对可能会堆积,但是epoll任务是比较少的
   > 
   > 如果改了优先级,会存在你说的优先级高的任务太多导致其他任务饿死
   
   @wanghenshui 
   是的,当前的改动是特化的,因为目前我只分析出了 epoll 这种任务同优先级带来的问题,所以就只修改了 epoll。
   我们是可以增加一个 priority queue,这样可以对使用 bthread 的人开发增加更多的可能性,但是还需要完善,像你说的,随意使用 
priority queue 可能会带来饥饿问题,在这个策略没想好之前,可以通过限制 queue 的大小,来一定程度保证不会饥饿,或者不开放这个接口,是 
private 的,只作为内部使用。


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