Collector operations are separated into per-collector thread
operations (the bulk of the GC), and per-mutator thread operations
(important in flushing and restoring per-mutator state such as allocator
state and write buffer/remset state). SimplePhase
ensures that per-collector thread GC phases are performed by each
collector thread, and that the M per-mutator thread operations
are multiplexed across the N active collector threads.
MMTk assumes that the VM instantiates instances of CollectorContext
in thread local storage (TLS) for each thread participating in
collection. Accesses to this state are therefore assumed to be
low-cost at GC time.
MMTk explicitly separates thread-local (this class) and global
operations (See Plan ), so that syncrhonization is localized
and explicit, and thus hopefully minimized (See Plan ). Global (Plan)
and per-thread (this class) state are also explicitly separated.
Operations in this class (and its children) are therefore strictly
local to each collector thread, and synchronized operations always
happen via access to explicitly global classes such as Plan and its
This class (and its children) therefore typically implement per-collector
thread structures such as collection work queues.