-
Notifications
You must be signed in to change notification settings - Fork 15
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
IOSim's MVars #10
IOSim's MVars #10
Conversation
94d2f68
to
c65fa2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just some minor comments.
GHC Timeout API uses MVars
in its implementation, mine #9 does not because at the time there wasn't a suitable MVar
definition in IOSim. I don't think I will change my PR to use MVar
s because these ones are based in STM and the whole purpose of my PR is to stay away from STM. My implementation mimics MVar
behavior in IOSim
so it should be good enough for now... I am not sure what @dcoutts is going to say about these MVar
s but a truly faithful MVar
implementation should be specific to IOSim
and thus implemented there, right?
Also stylish is failing in CI |
You're using the btw, this implementation relies on @dcoutts idea. |
I was, now it is using STRef's. How does STM provide fairness, I remember seeing that STM doesn't exactly guarantee fairness like MVars do |
|
Including a default implementation using 'MonadSTM', which guarantees fairness. Co-authored-by: Duncan Coutts <dcoutts@users.noreply.github.com>
So when you say:
what do you mean by fairness? what I understand by fairness here is that if you have various thread blocked on waiting for a |
It means blocked |
The same fairness (FIFO order) is guaranteed by |
@coot I understand now! Thank you! :D |
MVar's for
IOSim