The Dark Side of C++ Magic Statics: Non-Deterministic Destruction and More
ACCU Conference и cpponsea
0:00 / 0:00
The Dark Side of C++ Magic Statics: Non-Deterministic Destruction and More
1 901 просмотр · 13 дн. назад
ACCU Conference и cpponsea
1 901 просмотр · 13 дн. назад
ACCU Membership: https://tinyurl.com/ydnfkcyn
---
C++ Magic Statics Demystified - History, Internals, Pitfalls, and Optimizations - Kathleen Baker & Chandranath Bhattacharyya - ACCU 2026
---
Function-local static variables, colloquially known as ""magic statics"", have been a staple of thread-safe initialization since C++11, yet their internal mechanics remain a mystery to many. This talk explores the historical challenges with static initialization, including broken double-checked locking patterns and inefficient atomic-based solutions. We will deep dive into Mike Burrows’ algorithm, the foundation of the magic statics proposal, and compare real-world implementations of magic statics in MSVC and Clang. Furthermore, we will address the "dark side" of magic statics, including non-deterministic destruction and platform-specific hurdles on Windows and discuss robust solutions. Finally, we will look beyond magic statics toward compile-time data structures, offering practical techniques for safer and more efficient C++ code.
Slides: https://github.com/Digital-Medium/ACC...
---
Kathleen Baker
I'm a senior software engineer at Microsoft, currently working on the Edge browser team. I joined Microsoft after completing my undergraduate degree at the University of Alberta.
Chandranath Bhattacharyya
Chandranath Bhattacharyya has been a professional programmer since 2000, with most of his career focused on C++. He currently works at Microsoft on the Edge browser team and is a dedicated internal educator. Over the past five years, he has delivered around 40 C++ talks to an internal audience of more than 100 engineers, emphasizing clear explanations of language features and practical best practices.
He has also begun presenting at public C++ conferences, including one talk at C++Now 2025 and two talks at CppCon 2025. Chandranath serves as a reviewer for submissions to C++Now, C++OnSea, and CppCon.
Video Sponsored By JetBrains, Bloomberg Engineering & HRT
---
The ACCU Conference is the annual conference of the ACCU membership, but is open to any and all who wish to attend. The tagline for the ACCU is 'Professionalism in Programming', which captures the whole spectrum of programming languages, tools, techniques and processes involved in advancing our craft. While there remains a core of C and C++ - with many members participating in respective ISO standards bodies - the conference, like the organisation, embraces other language ecosystems and you should expect to see sessions on C#, D, F#, Go, Javascript, Haskell, Java, Kotlin, Lisp, Python, Ruby, Rust, Swift and more.The ACCU Conference is a conference by programmers for programmers about programming.
Discounted rates for members.
ACCU Membership: https://tinyurl.com/ydnfkcyn
2026 Program: https://accuonsea.uk/2026/schedule/in...
https://accu.org
https://www.accuconference.org/
https://mastodon.social/@ACCUConf
/ accu-conference
https://bsky.app/profile/accuconf.bsk...
/ accuorg
/ accuconf
---
YouTube Videos Filmed, Edited & Optimised by Digital Medium: https://events.digital-medium.co.uk
#cpp #cplusplus #programming #coding #softwareengineering #softwaredeveloper #code #cplusplusprogramming #cplusplustutorial #cplus #softwaredevelopment #coder #talk