Changes between Version 77 and Version 78 of LightweightConcurrency


Ignore:
Timestamp:
May 22, 2012 8:47:18 PM (2 years ago)
Author:
kc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LightweightConcurrency

    v77 v78  
    344344==== Unreachable Concurrent Datastructure ==== 
    345345 
    346 The [http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar BlockedIndefinitelyOnMVar] is raised on a thread that is blocked on an MVar, but the MVar has become unreachable. This is performed at the end of a garbage collection, just before resuming execution of the Haskell threads. In the vanilla RTS, after raising BlockedIndefinitelyOnMVar exception on a blocked thread, the thread is added back to the run queue. However, in the lightweight concurrency implementation, this is not so straightforward. In particular, ''How do we know whether the SCont 
     346The [http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#t:BlockedIndefinitelyOnMVar BlockedIndefinitelyOnMVar] is raised on a thread that is blocked on an MVar, but the MVar has become unreachable. This is performed at the end of a garbage collection, just before resuming execution of the Haskell threads. In the vanilla RTS, after raising BlockedIndefinitelyOnMVar exception on a blocked thread, the thread is added back to the run queue. However, in the lightweight concurrency implementation, this is not so straightforward. In particular,  
     347 
     348  * How do we know whether the SCont is blocked on a concurrent data structure in Haskell?  
     349  * How do we safely add the thread to the Haskell scheduler? 
     350 
     351We know that any SCont blocked with status `SContSwitched BlockedInHaskell` is blocked on a concurrent data structure. For an SCont that is blocked on a concurrent data structure which has become unreachable, we raise `BlockedIndefinitelyOnConcDS` exception. Subsequently, we utilize the SCont's scheduleSContAction to put the SCont back into its corresponding scheduler. Importantly, since the scheduler actions are PTM actions, the necessary synchronization is taken care of by the PTM layer.  
    347352 
    348353==== Unreachable Scheduler ====