29.11.2015 Views

The C11 and C++11 Concurrency Model

1ln7yvB

1ln7yvB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

150<br />

st<strong>and</strong>ard model<br />

T. 1<br />

with consume<br />

T. 2<br />

sc fenced<br />

T. 3<br />

T. 9<br />

sc accesses<br />

release acquire sc<br />

T. 4<br />

T. 27<br />

T. 12<br />

release acquire fenced<br />

sc only<br />

T. 5<br />

T. 10<br />

T. 13<br />

release acquire relaxed<br />

total<br />

T. 6<br />

T. 28<br />

relaxed only<br />

release acquire<br />

T. 29<br />

T. 7<br />

T. 11<br />

locks only<br />

T. 8<br />

single thread<br />

<strong>The</strong> equivalences provide several useful results. <strong>The</strong>orem 1 shows that part of the<br />

specification is redundant, as it is subsumed by the rest of the model. <strong>The</strong> rest of the<br />

equivalences show that one can consider a simpler model if the program does not use all<br />

of the features of the model. <strong>The</strong>orems 1, 2, 9, 12 <strong>and</strong> 13 establish one of the design<br />

goals of the language, for a restricted set of programs, without loops or recursion. This<br />

is the design goal described by Boehm <strong>and</strong> Adve [37]: data-race-free code that uses only<br />

regular reads <strong>and</strong> writes, locks, <strong>and</strong> the sequentially-consistent atomic accessor functions<br />

will execute with sequentially consistent semantics.<br />

<strong>The</strong> chapter begins with a precise formulation of what it means for two models to<br />

be equivalent, <strong>and</strong> then, using the graph above to organise the structure, presents the<br />

equivalence results <strong>and</strong> key insights from the proofs. <strong>The</strong>se results are presented in three<br />

paths through the graph, highlighted in blue red <strong>and</strong> green below:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!