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#23514unchecked (opened 2 August 2026unchecked).
Design write-up: Thread-local garbage collection (tgc) for D.
Org-site news: Thread-local GC proposed upstreamunchecked.
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.
Related work worth knowing
This is not the only active GC effort in the D community.
SymGCunchecked (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 GCunchecked.
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.
Forum discussion: https://forum.dlang.org/post/eyivmktfvmdlvhbyyphd@forum.dlang.orgunchecked.
What to read next
-
Full concepts, trade-offs, and partitioned shared regions (target design): blog article.
-
Canonical design + 0.1.0 scope: design notes.
-
Prototype branch:
dlang-supplemental/dmdfeature/tgcunchecked.