-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
stdout/stderr should be flushed when reading from stdin #25555
Comments
This seems like a decent "Do What I Mean" fix. |
nagisa
added a commit
to nagisa/rust
that referenced
this issue
May 18, 2015
This is possible now since we have reentrant mutexes. Fixes rust-lang#25555.
nagisa
added a commit
to nagisa/rust
that referenced
this issue
May 18, 2015
This is possible now since we have reentrant mutexes. Fixes rust-lang#25555.
nagisa
added a commit
to nagisa/rust
that referenced
this issue
May 18, 2015
This is possible now since we have reentrant mutexes. Fixes rust-lang#25555.
The associated PR for this issue was closed, so I'm going to close this as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As stdout is flushed only when a newline character is printed, the following program does not work properly:
Therefore, it is required to flush explicitly like
stdout().flush().unwrap()
. #23818 suggested always calling flush if anything is printed, but it is probably not acceptable due to the performance concerns.However, at least C and Python seem to have an implicit flushing behavior when
scanf()
/input()
is called, so the following works as expected:It would also be a good idea to adopt a similar strategy in Rust.
The text was updated successfully, but these errors were encountered: