| ... | ... | @@ -20,6 +20,12 @@ brief rationale. |
|
|
|
- `Control.Concurrent.Chan`, `Control.Concurrent.QSem`,
|
|
|
|
`Control.Concurrent.QSemN`, `Control.Concurrent.SampleVar`
|
|
|
|
|
|
|
|
- We need a thread-safe interface to mutable state, for use in library code that does not otherwise use concurrency.
|
|
|
|
We have two choices:
|
|
|
|
|
|
|
|
- Use `MVar`s. A non-concurrent implementation might implement them in terms of `IORef`, for example.
|
|
|
|
- Use STM. Easier to use, but not entirely trivial to implement, even in a single-threaded implementation, because exceptions have to abort a transaction ([ sample implementation](http://www.haskell.org//pipermail/haskell-prime/2006-March/001108.html)).
|
|
|
|
|
|
|
|
- Concurrent foreign calls are required.
|
|
|
|
**Rationale**:
|
|
|
|
|
| ... | ... | |