Master the fundamental concepts of garbage collection through this focused micro-challenge.
Stop-the-world pauses hurt latency. Concurrent mark-sweep runs marker alongside mutator with write barriers to catch new references. G1, ZGC, and Go's concurrent sweeper reduce pause times to milliseconds or sub-ms.
White: unvisited. Gray: visited, children pending. Black: fully scanned. Barrier ensures black objects do not point to white without gray intervention.
cLoading…
Production compilers embed this step inside a longer pipeline. GCC flows through cpp, cc1, assembly, and ld; Clang uses the driver, Sema, LLVM IR passes, and a target backend. LLVM bitcode, JVM bytecode, and WASM are other familiar IRs at the same layer. The exercise isolates one pass so you can test it alone before chaining it to the next stage.
You will understand concurrent garbage collection algorithms. This exercise asks you to model tri-color marking, write barriers, and how the collector maintains correctness while the mutator allocates.
Understand and simulate concurrent GC.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github