Skip to main content

Art of Performance

Tag: volatile

A Volatile Situation

As a hardware engineer, most of the code that I write is either in assembly or low-level C (apart from the shell scripts to run simulation jobs or Perl/Python to parse log files). I am therefore very familiar with the volatile type qualifier in the C language. Referring to my well-worn copy of the Kernighan and Ritchie “The C Programming Language” book, the section on volatile states: The purpose of volatile is to force an implementation to suppress optimization that could otherwise occur.