Skip to content

Conversation

sugar700
Copy link
Contributor

@sugar700 sugar700 commented Jun 4, 2020

Fixes #805.

Copy link
Member

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

sad, but the right thing to do until we have a correct implementation. Thank you

@sugar700
Copy link
Contributor Author

sugar700 commented Jun 4, 2020

I personally don't think it's possible to have a correct implementation that inter-ops with standard library's locks because of standard library's choice to have a reentrant mutex.

It may be possible to skip the standard library, and directly call C API directly. This should be sound on POSIX platforms (I'm not sure about non-POSIX platforms). Sure, it may lead to garbage reads and writes (https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html says that "The behavior of multiple concurrent reads on the same pipe, FIFO, or terminal device is unspecified") when sync I/O operations and async I/O operations are combined, but strictly speaking that's not unsafe.

@dignifiedquire dignifiedquire merged commit 6ca7b09 into async-rs:master Jun 4, 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.

StdoutLock is unsound
2 participants