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.

320<br />

<strong>The</strong> thread-local semantics collects these syntactic dependencies in the data dependence<br />

relation, dd, <strong>and</strong> that is passed to the memory model as part of the pre-execution.<br />

<strong>The</strong> relation is a partial order that identifies a subset of sequenced-before where there is<br />

data dependence between memory actions. <strong>The</strong> restrictions imposed on the relation in<br />

well formed threads are:<br />

strict partial order Xo.actions Xo.dd ∧<br />

Xo.dd subset Xo.sb<br />

B.1.6 Well-formed threads<br />

<strong>The</strong> action set, location kinds <strong>and</strong> relations of the pre-execution are generated by the<br />

thread-local semantics. <strong>The</strong> pre-executions that the thread-local semantics generates<br />

should all satisfy the basic properties established above. <strong>The</strong> well formed threads predicate<br />

gathers those requirements together:<br />

let well formed threads ((Xo, , ) : (pre execution ∗ execution witness ∗<br />

relation list)) =<br />

(∀ a ∈ Xo.actions. well formed action a) ∧<br />

actions respect location kinds Xo.actions Xo.lk ∧<br />

blocking observed Xo.actions Xo.sb ∧<br />

inj on aid of Xo.actions ∧<br />

relation over Xo.actions Xo.sb ∧<br />

relation over Xo.actions Xo.asw ∧<br />

threadwise Xo.actions Xo.sb ∧<br />

interthread Xo.actions Xo.asw ∧<br />

isStrictPartialOrder Xo.sb ∧<br />

isStrictPartialOrder Xo.dd ∧<br />

Xo.dd ⊆ Xo.sb ∧<br />

indeterminate sequencing Xo ∧<br />

isIrreflexive (sbasw Xo) ∧<br />

finite prefixes (sbasw Xo) Xo.actions<br />

B.2 Execution witness<br />

<strong>The</strong> execution witness represents the dynamic behaviour of memory in an execution. It<br />

is defined in the model as a record containing several relations:<br />

type execution witness =<br />

〈| rf : set (action ∗ action);<br />

mo : set (action ∗ action);

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

Saved successfully!

Ooh no, something went wrong!