3 ms·
Yeah, the canonical solution for multithreaded GC is the third option (TLABs). The TLS overhead is annoying, but on some architectures you can get away with bur
by pcwalton 9y ago
Yeah, the canonical solution for multithreaded GC is the third option (TLABs). The TLS overhead is annoying, but on some architectures you can get away with burning a register to save the TLS load. It might well be worth it on AArch64, with its 32 GPRs...
(TLABs are the recommended solution for multithreaded malloc implementations like jemalloc and tcmalloc as well.)
- cwzwarich 9y agoAArch64 has a dedicated register (TPIDR_EL0) for TLS.
- pcwalton 9y agoDidn't know that, thanks!
- Tarean 9y agoWhat is the TLS overhead? On x64 you presumably could spare two registers, one for the current heap pointer and one for the end of the heap. How could you implement this more efficiently with a single threaded version? Not sure if LLVM has an equivalent of global register variables, though.
- sitkack 9y agohttps://www.semanticscholar.org/paper/Hierarchical-PLABs%2C-CLABs%2C-TLABs-in-Hotspot-Kirsch-Payer/4a2162c1027cc5247140ec7eb7d1d46a569ab097 https://www.semanticscholar.org/paper/Hierarchical-PLABs%2C-...