Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distinguish channels more clearly between each process #244

Merged
merged 5 commits into from
Aug 30, 2021

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented Aug 29, 2021

No description provided.

Copy link
Collaborator

@yihuaf yihuaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more aggressive in putting down context for error message? Other than the comments, LGTM.

impl SenderExt for Sender {
#[inline]
fn write_message(&mut self, msg: Message) -> Result<()> {
self.write_all(&(msg as u8).to_be_bytes())?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add error context here for error msg?

}

pub fn intermediate_to_main() -> Result<(SenderIntermediateToMain, ReceiverFromIntermediate)> {
let (sender, receiver) = new_pipe()?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't new_pipe already has this part of the code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might as well have been asleep.

sender: Sender,
}

impl SenderInitToIntermediate {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we differentiate channel here, the init process don't ready send pid to the intermediate process, so the init_ready here don't have to send Pid. In the init process, since it is already inside the pid namespace, it doesn't know what is the real pid outside the pid namespace. The intermediate process knows the pid anyway since it is one doing the fork.

@utam0k
Copy link
Member Author

utam0k commented Aug 30, 2021

@yihuaf PTAL

@yihuaf yihuaf merged commit c6065e6 into youki-dev:main Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants