Changes between Version 1 and Version 2 of Commentary/Rts/Storage/GC/RememberedSets


Ignore:
Timestamp:
Dec 4, 2009 2:08:02 PM (4 years ago)
Author:
simonmar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Rts/Storage/GC/RememberedSets

    v1 v2  
    2626== Remembered set maintenance during mutation == 
    2727 
    28 While the mutator is running, we have to add any old-to-new generation pointers that are created.  Old-to-new pointers are created by mutating (writing to) an object in the old generation, and catching these writes is called a "write barrier".  Here are the cases we need to worry about in GHC: 
     28While the mutator is running, we have to add any old-to-new generation pointers that are created.  Old-to-new pointers are created by mutating (writing to) an object in the old generation, and catching these writes is called a "write barrier".   
     29 
     30A pointer can be added to a remembered set using  
     31 
     32{{{ 
     33void recordMutableCap (StgClosure *p, Capability *cap, nat gen); 
     34}}} 
     35 
     36This adds the pointer `p` to the remembered set for generation `gen`, using Capability `cap`.  Each Capability has its own remembered set for each generation, so that when running in parallel we can update remembered sets without taking a lock, and also so that we can take advantage of locality in the GC, by traversing a remembered set on the same CPU that created it. 
     37 
     38Here are the cases where we need a write barrier in GHC: 
    2939 
    3040=== Thunk Updates ===