You don't know jack about shared variables or memory models

Hans J. Boehm, Sarita V. Adve

Research output: Contribution to journalArticlepeer-review


Threads are multiple programs running at the same time while sharing variables. Shared variables are either the core strength of threads or the root of their evil, depending on a user's perspective. They allow threads to communicate easily and quickly, while making it possible for threads to get in each other's way. Experts are confused about the rules for using such shared variables despite these being at the core of most programs. It is observed that almost all processor architectures allow stores to memory to be saved in a buffer visible only to that processor core before writing them memory visible to other processor cores. The simplest view of threads is that a multi-ithreaded program is executed by interleaving steps from each thread. The most common way to avoid data races resulting from shared variables is to use mutexes to ensure mutual exclusion between code sections accessing the same variable.

Original languageEnglish (US)
Pages (from-to)48-54
Number of pages7
JournalCommunications of the ACM
Issue number2
StatePublished - Feb 2012
Externally publishedYes

ASJC Scopus subject areas

  • General Computer Science


Dive into the research topics of 'You don't know jack about shared variables or memory models'. Together they form a unique fingerprint.

Cite this