baidu / baidu/sofa-pbrpc

try_start_receive是否可以省略_receive_token

Open
#222 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.1k
Forks
649
PR merge metrics
No merged PRs in 30d

Description

Server端连接首次try_start_receive是在RpcListener::on_accept里头调用RpcByteStream::set_socket_connected时出发,另外当发送完成后会在on_read_some里继续触发,虽然每次on_read_some是在不同线程执行,但执行过程是串行的

Client端连接首次try_start_receive是在RpcByteStream::on_connect里,另外发送完成后也是在on_read_some里继续触发,也不会有并行操作的可能

因此在try_start_receive里是不是可以不需要获取token

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with try_start_receive and trace its callers through RpcListener::on_accept, RpcByteStream::set_socket_connected, RpcByteStream::on_connect, and on_read_some on both server and client paths. Verify the claimed serial execution against the token’s synchronization role; done means a justified decision on whether _receive_token can be removed, with the implementation and concurrency coverage updated if removal is safe.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend-api-design, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.