Microsoft Corporation
Reducing synchronization reliance in marking
Last updated:
Abstract:
Memory reclamation is tailored to avoid certain synchronization instructions, speeding concurrent garbage collection while preserving data integrity and availability. Garbage collection reclaims objects no longer in use, or other unused areas of memory. Pointers are partitioned into address portions holding address values and non-address portions having a special bit. Marking code writes only the non-address portions, setting the special bit as a mark reference, relocation candidate, etc. Mutator threads may concurrently mutate the entire pointer to update the address, but mutation does not cause incorrect reclamations or failure to do other operations such as relocation. Meanwhile, execution speed is increased by avoiding CAS (compare-and-swap instructions or compare-and-set) synchronization instructions. Non-CAS yet nonetheless atomic writes are used instead. Mutators run in user or kernel address spaces. Partitioned pointers and their use may be enclosed to avoid runtime errors by code that expects references to be in a canonical non-partitioned form.
Utility
12 Sep 2020
12 Apr 2022