Opt-in thread-local GC (tgc) proposed upstream

We submitted an opt-in thread-local garbage collector for D—registered as tgc—to upstream DMD/druntime on 2 August 2026 (23:02 UTC). The implementation is a 0.1.x smoke prototype (currently 0.1.1), not a finalized v1.

Upstream PR: dlang/dmd#23514 (opened 2 August 2026).

Why it matters

D isolates thread-local data by default, but the standard GC still uses one process-wide heap and stop-the-world collection. That pauses @nogc realtime threads whenever any other thread collects. tgc gives each thread a private heap and collects without a global pause, selected only when you ask for it:

./app --DRT-gcopt=gc:tgc

The default conservative GC is unchanged. Informally this is sometimes called a “realtime GC”; the runtime name is tgc.

This is not the only active GC effort in the D community. SymGC (Steven Schveighoffer / Symmetry Investments; select with --DRT-gcopt=gc:sdc) focuses on removing the global allocation lock and other modern-GC improvements, with DConf ’24 talks such as We Need a New GC. It may become a future default; whether the classic shared heap remains selectable is still evolving. tgc is a narrower opt-in experiment aimed at pause isolation between threads (and @nogc workers), not a claim that SymGC is irrelevant—see the blog section for the comparison.

What to read next