WingsGo commented on issue #2120:
URL: https://github.com/apache/brpc/issues/2120#issuecomment-1439532992

   > > @chenzhangyi @wwbmmm 
我理解对于baidu_rpc协议来说,meta和payload的length是在协议头就已经确定好了的,这样可以修改append_from_file_descriptor,在从socket的fd读取数据的时候,将allocate内存的方法提供给用户,然后通过append_user_data就可以在recever端减少这一次拷贝了吧?我可以提一个PR来实现一下,不知道这样的方案是否可行?
   > 
   > 可以考虑给iobuf加个reserve_continuous_buffer(int size)方法,然后由协议来控制预留buffer的大小
   
   
那是否可以这么设计,通过flag控制是否调用reserve_continuous_buffer,并且在IOBuf中除了smallView和bigView,增加一个continuousView,使用一个BlockRef来代表这一块连续的内存,并提供接口给用户访问这块连续内存,这块内存的生命周期和IOBuf绑定?


-- 
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: [email protected]

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