Skip to content

Give a usable buffer to _pipe on Windows - #182

Merged
snoyberg merged 1 commit into
haskell:masterfrom
Mistuke:patch-1
Jun 8, 2020
Merged

Give a usable buffer to _pipe on Windows#182
snoyberg merged 1 commit into
haskell:masterfrom
Mistuke:patch-1

Conversation

@Mistuke

@Mistuke Mistuke commented Jun 7, 2020

Copy link
Copy Markdown
Contributor

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.

@snoyberg snoyberg left a comment

Copy link
Copy Markdown
Collaborator

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

snoyberg commented Jun 7, 2020

Copy link
Copy Markdown
Collaborator

@TerrorJack Could you review if this addresses your issue?

@TerrorJack TerrorJack left a comment

Copy link
Copy Markdown
Contributor

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