-
Notifications
You must be signed in to change notification settings - Fork 346
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
Conversation
There was a problem hiding this 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.
src/process/channel.rs
Outdated
impl SenderExt for Sender { | ||
#[inline] | ||
fn write_message(&mut self, msg: Message) -> Result<()> { | ||
self.write_all(&(msg as u8).to_be_bytes())?; |
There was a problem hiding this comment.
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()?; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
@yihuaf PTAL |
No description provided.