yichenluan commented on issue #1047:
URL: https://github.com/apache/incubator-brpc/issues/1047#issuecomment-618873519


   > > > > 我这边也有类似的需求,要求单链接严格有序
   > > > > 
我看socket部分的代码,epoll过来的事件,是按照fd起bthread处理的,如果前一个pipeline特别大,后一个特别小,感觉是有可能在InputManager这里有两个InputManager并发的情况出现,即使都走到Parse这里也可能是并行的Parse
   > > > 
   > > > 
   > > > 这个不会呀,InputMessenger 中是 OnNewMessages 来循环处理 socket 的读 
event,我现在的处理方式就是在 Parse 阶段完成消息的 decode、process,对于异步处理,会通过 bthread 的 
CountdownEvent 来将 bthread 休眠
   > 
   > 
![image](https://user-images.githubusercontent.com/16607943/80180960-7ce59c80-8636-11ea-851b-5000ce0f21be.png)
   > 
我看process也是起一个尽量分配到当前线程的bthread来执行的,以上这一段在socket.cpp里面,由EventDispatcher在收到epoll的触发后调用
   
   我再看看代码再回复你,不太可能 parse 阶段也会有并发问题,因为 parse 阶段才去读 socket,并发读怎么读消息呢


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



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

Reply via email to