Skip to content

discuss deadlocks in the std::io::pipe() example #141109

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

Merged
merged 1 commit into from
May 23, 2025

Conversation

oconnor663
Copy link
Contributor

I think it's important to discuss deadlocks in examples of how to use pipes. The current example does include an explicit drop(), but it also implicitly relies on the fact that the Command object is temporary, so that it drops its copy of pong_tx. This sort of thing tends to trip people up when they use pipes for the first time. I might've gone overboard with the comments in this version, but I'm curious what folks think.

@rustbot
Copy link
Collaborator

rustbot commented May 17, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 17, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 23, 2025

📌 Commit dcef449 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 23, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 23, 2025
…mulacrum

discuss deadlocks in the std::io::pipe() example

I think it's important to discuss deadlocks in examples of how to use pipes. The current example does include an explicit `drop()`, but it also implicitly relies on the fact that the `Command` object is temporary, so that it drops its copy of `pong_tx`. This sort of thing tends to trip people up when they use pipes for the first time. I might've gone overboard with the comments in this version, but I'm curious what folks think.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136400 (Improve handling of rustdoc lints when used with raw doc fragments.)
 - rust-lang#140967 (Async drop poll shim for error dropee generates noop body)
 - rust-lang#141019 (Update std doctests for android)
 - rust-lang#141062 (Update IDEs to use rustfmt 2024, fix Zed settings)
 - rust-lang#141109 (discuss deadlocks in the std::io::pipe() example)
 - rust-lang#141126 (rustdoc JSON: Don't apply `#[repr]` privacy heuristics)
 - rust-lang#141376 (Rename `kw::Empty` as `sym::empty`.)
 - rust-lang#141383 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request May 23, 2025
Rollup of 7 pull requests

Successful merges:

 - #136400 (Improve handling of rustdoc lints when used with raw doc fragments.)
 - #140967 (Async drop poll shim for error dropee generates noop body)
 - #141019 (Update std doctests for android)
 - #141109 (discuss deadlocks in the std::io::pipe() example)
 - #141126 (rustdoc JSON: Don't apply `#[repr]` privacy heuristics)
 - #141376 (Rename `kw::Empty` as `sym::empty`.)
 - #141383 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dfa3110 into rust-lang:master May 23, 2025
6 checks passed
@rustbot rustbot added this to the 1.89.0 milestone May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants