| ... | ... | @@ -2,20 +2,49 @@ |
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
- [ A Draft report addendum](http://www.haskell.org/ghc/docs/papers/threads.ps.gz) describing the interaction between GHC's concurrency and the FFI.
|
|
|
|
|
|
|
|
on the wiki:
|
|
|
|
|
|
|
|
- [ForeignBlocking](foreign-blocking)
|
|
|
|
|
|
|
|
|
|
|
|
Documentation:
|
|
|
|
|
|
|
|
- The [ Control.Concurrency](http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Concurrent.html) module
|
|
|
|
|
|
|
|
|
|
|
|
Papers and other docs:
|
|
|
|
|
|
|
|
- [ Concurrent Haskell](http://www.haskell.org/ghc/docs/papers/concurrent-haskell.ps.gz) (the original paper, including a semantics)
|
|
|
|
- [ Extending the Haskell FFI with Concurrency](http://www.haskell.org/~simonmar/papers/conc-ffi.pdf) (a specification of the interaction between concurrency and the FFI, with a semantics)
|
|
|
|
- [ A Draft report addendum](http://www.haskell.org/ghc/docs/papers/threads.ps.gz) (a shorter version of the above paper).
|
|
|
|
- [ Software Transactional Memory](http://research.microsoft.com/~simonpj/papers/stm/)
|
|
|
|
- [ForeignBlocking](foreign-blocking)
|
|
|
|
|
|
|
|
## Pros
|
|
|
|
|
|
|
|
- Vital for some modern applications and large applications commonly require it
|
|
|
|
- Stable MVar implementation is well understood and tested
|
|
|
|
- Vital for some modern applications and large applications commonly require it.
|
|
|
|
- Stable `MVar` implementation is well understood and tested.
|
|
|
|
|
|
|
|
## Cons
|
|
|
|
|
|
|
|
- Imposes non trivial implementation constraints.
|
|
|
|
- Providing a 'select' and non-blocking IO would be enough to allow people to implement something like it themselves in haskell and are provided by most systems as primitives.
|
|
|
|
- Things like the 'poor man's concurrency monad' can achieve some of the benefits
|
|
|
|
- only one implementation exists, design space not very well explored.
|
|
|
|
- Unsure at this point if new STM will replace older MVar-style concurrency |
|
|
|
|
|
|
|
## Proposal
|
|
|
|
|
|
|
|
- Standardise on Concurrent Haskell without STM. It is our view that even in the presence of STM, `MVar`s offer
|
|
|
|
functionality that is distinct from STM and separately useful, so this leaves room for growth.
|
|
|
|
|
|
|
|
- Use the semantics from [ Extending the Haskell FFI with Concurrency](http://www.haskell.org/~simonmar/papers/conc-ffi.pdf)
|
|
|
|
|
|
|
|
|
|
|
|
Questions:
|
|
|
|
|
|
|
|
- Decide how much pre-emption is acceptable, and figure out how to specify this.
|
|
|
|
|
|
|
|
- Should we specify what an implementation that doesn't provide concurrency should do? (e.g. provide an implementation
|
|
|
|
of MVars in terms of IORefs, so that concurrency-safe libraries can be written portably).
|
|
|
|
|
|
|
|
- Require bound thread support, or make it optional? (YHC has concurrency with non-blocking foreign calls, but doesn't
|
|
|
|
have bound threads as yet.) |