Lightning Talk: How to Cook Your CPU with C++
summary
A change in compiler optimization from -O0 vs -O2 turns a benign spin-check into an infinite loop that pins a core at 100% CPU after a rebuild, because the compiler assumes a locally-read flag never changes and optimizes away repeated checks. Tracing uses htop, perf and GDB plus quick assembly inspection to confirm the jump-generated loop. The practical fix is to use proper synchronization such as atomic_bool (or another suitable primitive) instead of a plain variable.
AI-written summary · about
related talks
01h 30mTuning C++: Benchmarks, and CPUs, and Compilers! Oh My!
01h 01mPlenary: Performance Matters
01h 27mDangerous Optimizations! in C++ - Part Deux
01h 37mAn Overview of Program Optimization Techniques
53mOptimizing C for Microcontrollers - Best Practices
06mLightning Talk: Volatile none of the things
03mLightning Talk: Undefined Behaviour in C++
57mModern Linux C++ debugging tools - under the covers
