Changes between Version 61 and Version 62 of LightweightConcurrency

May 20, 2012 10:41:54 PM (5 years ago)



  • LightweightConcurrency

    v61 v62  
    1919  * [#Schedulers Schedulers]
    2020  * [#MVars MVars]
    21  * [#CapabilitiesandTasks Capabilities and Tasks]
     21 * [#ParallelismandSystemThreads Parallelism and System Threads]
     22  * [#TaskModel Task Model]
    2223  * [#SContAffinity SCont Affinity]
    2324  * [#BoundSCont Bound SCont]
    257258As an aside, the race condition in [ 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.
    259 == Capabilities and Tasks ==
     260== Parallelism and System Threads ==
    261262Whatever 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.
     264=== Task Model ===
    263266We 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.
    286289Creating 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.
    288 == Scaling on Multicores ==
    290291== Scheduler Interaction with RTS ==