https://cppcon.org
---
What Volatile Means (and Doesn’t Mean) in C++ Programming - Ben Saks - CppCon 2024
---
Using the volatile keyword correctly is vital when accessing hardware devices in C++. Unfortunately, the volatile keyword is among the most misunderstood aspects of the language. If you don’t use volatile appropriately, you may find the compiler generating code that’s very different from what you intended.
This session will help you write more robust device drivers that avoid common mistakes surrounding volatile. Step by step, it explains:
- Why volatile is necessary
- How volatile affects the code that the compiler generates
- How you should place volatile in object declarations
- Which statements the compiler is and isn’t allowed to reorder around accesses to volatile objects
- How to avoid misusing volatile
- How to avoid introducing inefficiencies when using volatile objects
---
Slides: https://github.com/CppCon/CppCon2024/blob/main/Presentations/What_Volat…
Sponsored by JetBrains: https://www.jetbrains.com/clion/
---
Ben Saks
Ben Saks is the chief engineer of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Ben has represented Saks & Associates on the ISO C++ Standards committee as well as two of the committee’s study groups: SG14 (low-latency) and SG20 (education). He has spoken at industry conferences, including the C++ and System Software Summit, the Embedded Systems Conference, NDC Techtown, and CppCon, where he’s also chair of the Embedded Track and a member of the program committee. Ben previously worked as a software engineer for Vorne Industries, where he used C++ and JavaScript to develop embedded systems that help improve manufacturing productivity in factories all over the world. He’s also a contributing author on multiple Vorne patents.
---
CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - https://www.cppcon.org
https://www.linkedin.com/company/cppcon
https://x.com/cppcon
https://www.facebook.com/CppConference
https://www.reddit.com/r/cppcon/
https://mastodon.social/@CppCon
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: https://events.digital-medium.co.uk
---
#cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #softwaredevelopment #softwareengineering #coding #code #technology #cppdevelopment #programming #programmer