Implement an atomic readMVar
Requested by various people, most recently by John Launchbury.
The idea would be that readMVar is atomic, and never blocks if the MVar is full. A concurrent putMVar operation cannot intervene while readMVar is reading the value.
To implement this, we would need two kinds of blocked threads in the MVar queue, and putMVar would need to wake up zero or more readMVar operations followed by at most one takeMVar.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.12.2 |
| Type | Task |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Runtime System |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |