Changes between Version 129 and Version 130 of LightweightConcurrency


Ignore:
Timestamp:
Jun 3, 2012 4:07:47 AM (23 months ago)
Author:
kc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LightweightConcurrency

    v129 v130  
    259259Notice that just like yield and forkIO, takeMVar is scheduler agnostic; the MVar implementation is cleanly separated from the scheduler implementation. Moreover, the same MVar might be shared between threads from different schedulers since they utilize the uniform scheduler interface. Since the scheduler actions are PTM actions, actions from different schedulers can be composed together elegantly and simplifies reasoning about synchronization. An implementation of a MVar can be found [source:libraries/lwconc/LwConc/MVar.hs?rev=76dc667761e38fec47e7b1aba27bb4c499fd7636 here]. 
    260260 
    261 As an aside, the race condition in [http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Concurrent-MVar.html#v%3AswapMVar swapMVar] can be [eliminated] with the help of PTM abstraction. Thus, PTM abstraction makes it easy to construct correct concurrent data-structures.  
     261As an aside, the race condition in [http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Concurrent-MVar.html#v%3AswapMVar swapMVar] can be [source:libraries/lwconc/LwConc/MVar.hs?rev=a51ce194ecaf598ded3cdbf065b1a470e029ccab#L89 eliminated] with the help of PTM abstraction. Thus, PTM abstraction makes it easy to construct correct concurrent data-structures.  
    262262 
    263263== System Threads and Parallelism ==