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

move fflush to a thread #16

Merged
merged 3 commits into from
May 16, 2018
Merged

move fflush to a thread #16

merged 3 commits into from
May 16, 2018

Conversation

minrk
Copy link
Owner

@minrk minrk commented May 9, 2018

fflush can block if buffers are full

include regression test for large output

closes #15

fflush can block if buffers are full

include regression test for large output
libc.fflush(c_stderr_p)
r, w, x = select.select(pipes, [], [], self.flush_interval)
if not r:
r, w, x = select.select(pipes, [], [], flush_interval)
Copy link

@gidim gidim May 10, 2018

Choose a reason for hiding this comment

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

Why did you changeself.flush_interval to flush_interval?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Because now it may be self._flush_interval or 0 depending on the previous state.

avoids blocking the reader thread in a call to fflush on the writer pipe,
which will only unblock when the reader is finished
@minrk minrk changed the title only call fflush if there’s no output to be read move fflush to a thread May 14, 2018
@minrk minrk merged commit 99e7b65 into master May 16, 2018
@minrk minrk deleted the big-flush branch May 16, 2018 11:11
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.

Wurlitzer hangs process when pipe/buffer is full
2 participants