Changes between Version 63 and Version 64 of LightweightConcurrency


Ignore:
Timestamp:
May 20, 2012 11:09:35 PM (2 years ago)
Author:
kc
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LightweightConcurrency

    v63 v64  
    195195  let epilogue = atomically $ do { 
    196196    sc <- getCurrentSCont; 
    197     setSContSwitchReason Completed; 
     197    setSContSwitchReason sc Completed; 
    198198    switchToNext <- getYCA sc; 
    199199    switchToNext 
     
    260260== Parallelism and System Threads == 
    261261 
    262 Whatever be the concurrency model, we would like to retain the non-programmatic control over parallelism (using +RTS -N). Just like in the current system, this runtime parameter controls the maximum number of capabilities. Cores are system resources and hence, the control over their allocation to different processes should be a property of the context under which the programs are run. The concurrency substrate provides  
     262Whatever be the concurrency model, we would like to retain the non-programmatic control over parallelism (using +RTS -N). Just like in the current system, this runtime parameter controls the maximum number of capabilities. Cores are system resources and hence, the control over their allocation to different processes should be a property of the context under which the programs are run. The concurrency substrate exposes the primitive 
    263263 
    264264{{{ 
     
    266266}}} 
    267267 
     268which runs the given SCont on a free capability. If there are no free capabilities, a runtime error is raised. A typical, initial task spawned on another core would pull work from the scheduler and switch to it. For example, 
     269 
     270{{{ 
     271initialTask :: IO () 
     272initialTask = atomically $ do 
     273  s <- getCurrentSCont 
     274  yca <- getYCA s 
     275  setSContSwitchReason s Completed 
     276  yca 
     277}}} 
     278 
    268279=== Task Model === 
    269280 
     
    275286 
    276287{{{ 
     288getNumCapabilities ::  
    277289setSContCapability :: SCont -> Int -> IO () 
    278290getSContCapability :: SCont -> PTM Int