Changes between Version 39 and Version 40 of Concurrency


Ignore:
Timestamp:
Apr 22, 2006 1:22:15 AM (9 years ago)
Author:
john@…
Comment:

strengthen fairness guarentee of cooperative model, add various pros and cons.

Legend:

Unmodified
Added
Removed
Modified
  • Concurrency

    v39 v40  
    6363 * Cooperative systems can be faster, and are simpler to implement 
    6464   (see state threads reference). 
     65 * it is fairly difficult to tell the difference between a cooperative (with 
     66   progress guarentee) and a preemptive system in practice on non contrived 
     67   programs. 
     68 * STM is trivial and much more efficient to implement. no need to rollback 
     69   ever except on an explicit exception. Can be almost as fast as IORefs. 
    6570 
    6671'''Cons''' 
     
    9499   programmer must think about "what is evaluated" when 
    95100   programming concurrent code. 
     101 * The main benefit of preemption, latency, cannot be guarenteed anyway. 
    96102 
    97103[[BR]] 
     
    102108 * It affects the fairness/progress guarantees, including the 
    103109   possibility of priorities from the outset may be simpler. 
     110 * Need to decide how rigidly to specify them. are they advisory? do we 
     111   require priority inversion protection? 
    104112 
    105113'''Cons''' 
    106  * Hard to implement, no implementations yet. 
     114 * Can be hard to implement, no implementations yet. 
    107115 
    108116 
     
    231239Additionally, we have a fairness property of {{{MVar}}}s: 
    232240 
     241 * every thread is guarenteed to run in a finite amount of time if a program 
     242   yields infinitly often. (weak fairness) 
     243 
    233244 * A thread blocked on an {{{MVar}}} will eventually run, provided there are no other 
    234    threads holding the {{{MVar}}} indefinitely. 
     245   threads holding the {{{MVar}}} indefinitely. (this is implied by the previous rule) 
    235246 
    236247This means that {{{MVar}}} blocking must be implemented in a fair way, eg. a FIFO of blocked threads.