Merged
Conversation
3e19457 to
63d7868
Compare
jorisdral
commented
Oct 4, 2024
Comment on lines
44
to
50
| -- Warning: This implementation is not robust under concurrent use (because | ||
| -- operations on files are not atomic) but should be ok for casual use. A | ||
| -- proper implementation would need to be part of the underlying 'HasFs' | ||
| -- implementations. |
It's an adequate implementation, but not perfect. It passes the test, but would fail if there were genuine concurrency. Doing it properly would need an implementation in fs-api and fs-sim. Fortunately we do not need a concurrency safe implementation (for now). Co-authored-by: Duncan Coutts <duncan@well-typed.com> Co-authored-by: Joris Dral <joris@welltyped.com>
With the nice addition that we now assert that there are no open file handles at the end of each iteration of the tests! We also tweak the state machine tests. We now follow a more normal convention, and allow running individual tests more easily in GHCi via `quickCheck $ theProperty`. Co-authored-by: Duncan Coutts <duncan@well-typed.com> Co-authored-by: Joris Dral <joris@welltyped.com>
2ee8a84 to
a868ca2
Compare
dcoutts
approved these changes
Oct 7, 2024
| -- Warning: regular file operations on the "locked" file, like 'hOpen' or | ||
| -- 'removeFile', will still work. 'simTryLockFile' only defines how multiple | ||
| -- lock acquisitions on the same file interact, not how lock acquisition | ||
| -- interacts with other file operations. |
Collaborator
There was a problem hiding this comment.
The same is true for the normal API too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's neat is that we can now find out in our
StateMachinetests whether our implementation is leaking file descriptors!