-
Notifications
You must be signed in to change notification settings - Fork 86
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
Use newer version of io-sim #4047
Conversation
66254b4
to
c86b1c8
Compare
ecceddc
to
ff973ae
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.
LGTM modulo adding some more context in the two TODO's we have introduced.
(newTMVar, newTMVarIO) | ||
import Control.Concurrent.Class.MonadSTM.Strict.TVar as StrictSTM hiding | ||
(newTVar, newTVarIO, newTVarWithInvariantIO) | ||
-- TODO: use strict versions of 'TQueue' and 'TBQueue' |
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.
Could we give a rationale on why this is required? Eg what would happen if we don't use the strict versions of these queue types?
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.
The queues could store thunks which could will be evaluated only once they are read from the queue. This could retain memory for longer than necessary.
Since the strict version was imported in the original version, I guess using strict queues was the intention, it used non-strict queues because they were not implemented and the Control.Monad.Class.MonadSTM.Strict
module exported non-strict ones.
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.
I updated the todo.
@@ -5,6 +5,7 @@ | |||
{-# LANGUAGE TupleSections #-} | |||
{-# LANGUAGE TypeFamilies #-} | |||
|
|||
-- TODO: this module ought to use 'MonadMVar', and be moved to `strict-stm`. |
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.
It'd help whoever needs to do this to provide a rationale for this.
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.
There are two reasons:
- make the implementation more robust (the implementation here is wrong,
MVar
's supposed to provide fairness, whichTVar
's do not provide) - make it a standalone package which extends
io-sim
(in the same waystrict-stm
extends it)
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.
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.
I updated the todo.
c9e60bc
to
33bbbb0
Compare
33bbbb0
to
43a587a
Compare
bors merge |
Description
Update to newer version of
io-sim
(see input-output-hk/io-sim#24).Checklist
interface-CHANGELOG.md
interface-CHANGELOG.md