A Deep dive into (implicit) Thread Local Storage
Thread Local Storage (henceforth TLS) is pretty cool, it may appear to be simple at first glance but a good and efficient TLS implementation requires concerted effort from compiler, linker, dynamic linker, kernel, and language runtime.
On Linux, an excellent treatment to this topic is
Ulrich Drepper’s ELF Handling For Thread-Local Storage, this blog post is my take on the same topic but with a different emphasis on how the details are presented.
We’ll limit the scope to x86-64, with a primary fo...
Read more at chao-tic.github.io