Changes between Version 61 and Version 62 of LightweightConcurrency
- Timestamp:
- 05/20/12 15:41:54 (12 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LightweightConcurrency
v61 v62 19 19 * [#Schedulers Schedulers] 20 20 * [#MVars MVars] 21 * [#CapabilitiesandTasks Capabilities and Tasks] 21 * [#ParallelismandSystemThreads Parallelism and System Threads] 22 * [#TaskModel Task Model] 22 23 * [#SContAffinity SCont Affinity] 23 24 * [#BoundSCont Bound SCont] … … 257 258 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. TODO: show example. Thus, PTM abstraction makes it easy to construct correct concurrent data-structures. 258 259 259 == Capabilities and Tasks ==260 == Parallelism and System Threads == 260 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 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. For example, in a multi-programmed environment, it might be wiser to run the programs on a fewer cores than available to avoid thrashing. At the very least, this will avoid the cases where a poorly written concurrency library would not bring down the performance of the entire system. 263 264 === Task Model === 262 265 263 266 We retain the task model of the current runtime system. There is a one-to-one mapping between tasks and system threads. Tasks are not exposed to the programmer and is transparently managed by the RTS. … … 285 288 286 289 Creating a bound SCont creates a new task, which is the only task capable of running the bound SCont. When switching to a bound SCont, the RTS transparently switches to the corresponding bound task. Similarly, when switching away from a bound SCont, the RTS suspends the current bound task, and switches to another appropriate task. However, an unbounded SCont (created through `newSCont` primitive) might be run on any unbounded task (referred to as worker tasks). New worker tasks might be created by the RTS on demand. 287 288 == Scaling on Multicores ==289 290 290 291 == Scheduler Interaction with RTS ==
