Changes between Version 63 and Version 64 of LightweightConcurrency
- Timestamp:
- 05/20/12 16:09:35 (13 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LightweightConcurrency
v63 v64 195 195 let epilogue = atomically $ do { 196 196 sc <- getCurrentSCont; 197 setSContSwitchReason Completed;197 setSContSwitchReason sc Completed; 198 198 switchToNext <- getYCA sc; 199 199 switchToNext … … 260 260 == Parallelism and System Threads == 261 261 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 provides262 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 exposes the primitive 263 263 264 264 {{{ … … 266 266 }}} 267 267 268 which 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 {{{ 271 initialTask :: IO () 272 initialTask = atomically $ do 273 s <- getCurrentSCont 274 yca <- getYCA s 275 setSContSwitchReason s Completed 276 yca 277 }}} 278 268 279 === Task Model === 269 280 … … 275 286 276 287 {{{ 288 getNumCapabilities :: 277 289 setSContCapability :: SCont -> Int -> IO () 278 290 getSContCapability :: SCont -> PTM Int
