You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/11/17 07:31:20 UTC

[GitHub] [incubator-brpc] Tuvie commented on a diff in pull request #1999: allow IOBuf::append_user_data specifying any valid address in registered rdma memory region

Tuvie commented on code in PR #1999:
URL: https://github.com/apache/incubator-brpc/pull/1999#discussion_r1024837535


##########
src/brpc/rdma/rdma_helper.cpp:
##########
@@ -99,37 +99,41 @@ static ibv_device** g_devices = NULL;
 static ibv_context* g_context = NULL;
 static SocketId g_async_socket;
 static ibv_pd* g_pd = NULL;
-static std::vector<ibv_mr*>* g_mrs = NULL;
+static std::vector<ibv_mr*>* g_mrs = NULL; // mr registered by brpc

Review Comment:
   > 可以按照地址排列成有序集合,用二分法查找更快
   
   这么用是为了避免在后续GetLkey的时候上锁,数组虽然效率不好但是线程间竞争影响可忽略。高级一点的数据结构无锁化高效实现没想好怎么做。或者就是把线程竞争的处理留给上层的应用去考虑。有什么建议么?



-- 
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-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org