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

Give a usable buffer to _pipe on Windows #182

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Conversation

Mistuke
Copy link
Contributor

@Mistuke Mistuke commented Jun 7, 2020

Fixes #181, the documentation seems to have been misread, the argument to _pipe is the number of bytes to reserve for pipe communications, not the number of pipes to create. This ended up making pipes that can only send 2 bytes at a time.

The pipes are created in blocking mode, so any write of larger than 2 bytes block and no read returns more than 2 bytes..

Instead use 8k which is the size of the internal Buffers in Base which back I/O calls.

Fixes haskell#181, the documentation seems to have been misread, the argument to `_pipe` is the number of bytes to reserve for pipe communications, not the number of pipes to create.  This ended up making pipes that can only send 2 bytes at a time.

Instead use 8k which is the size of the internal Buffers in `Base` which back `I/O` calls.
Copy link
Collaborator

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

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

Super fast fix, thanks!

@snoyberg
Copy link
Collaborator

snoyberg commented Jun 7, 2020

@TerrorJack Could you review if this addresses your issue?

Copy link
Contributor

@TerrorJack TerrorJack left a comment

Choose a reason for hiding this comment

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

Validated locally.

@snoyberg snoyberg merged commit f2f0c2f into haskell:master Jun 8, 2020
snoyberg added a commit that referenced this pull request Jun 8, 2020
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.

createPipe doesn't work on Windows
3 participants