09.08.2013 Views

Design and Verification of Adaptive Cache Coherence Protocols ...

Design and Verification of Adaptive Cache Coherence Protocols ...

Design and Verification of Adaptive Cache Coherence Protocols ...

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.

<strong>and</strong> release locks, which guard every shared writable variable. One <strong>of</strong> the powers <strong>of</strong> sequential<br />

consistency is that the lock operations can be de ned in the model itself. When used properly,<br />

locks ensure that only one processor at a time can access a shared variable (though it is <strong>of</strong>ten<br />

safe to read a shared variable without acquiring the lock).<br />

It is common practice in parallel programming to use semaphores to synchronize concurrent<br />

processes or threads properly to avoid data races. A data race occurs when there are multiple<br />

concurrent accesses to a shared variable, at least one <strong>of</strong> which is a write operation. Intuitively,<br />

a program is properly-synchronized if it contains enough synchronization operations so that<br />

con icting memory accesses are always ordered by synchronization operations (that is, data<br />

races are limited to acquiring semaphores).<br />

It is possible to relax some constraints <strong>of</strong> sequential consistency in many sections <strong>of</strong> prop-<br />

erly synchronized programs. Program-oriented memory models allow memory accesses to be<br />

reordered <strong>and</strong> store operations to be performed in some non-atomic fashion based on the com-<br />

mon intuition that properly-synchronized programs can behave sequentially consistent on an<br />

architecture supporting some relaxed memory model. Although it is generally undecidable if<br />

a program is properly-synchronized, it is <strong>of</strong>ten relatively convenient for the programmer to<br />

characterize each memory operation as ordinary or synchronization access.<br />

Program-oriented memory models can be <strong>of</strong>ten de ned in terms <strong>of</strong> some synchronization<br />

constraints on the program. The system guarantees to appear sequentially consistent provided<br />

that the program conforms to the synchronization constraints [2, 3, 47]. The intuition behind<br />

is that we can ensure sequential consistency for properly-synchronized programs by just placing<br />

coherence restrictions on synchronizations. Therefore, the programmer can rely on sequential<br />

consistency to reason about the program, although the memory access operations are performed<br />

in some out-<strong>of</strong>-order <strong>and</strong> non-atomic fashion.<br />

Program-oriented memory models usually require that ordinary memory access operations<br />

be distinguished from synchronization operations. Furthermore, di erent synchronization op-<br />

erations can be exposed in di erent forms, which canhave di erent coherence implications on<br />

implementations. Synchronization operations can be classi ed as acquire <strong>and</strong> release opera-<br />

tions, loop <strong>and</strong> non-loop operations, <strong>and</strong> so on. Based on such classi cation, notions such as<br />

Data-Race-Free programs [2, 3] <strong>and</strong> Properly-Labeled programs [47, 46] have beendeveloped.<br />

Data-Race-Free-0 [2] only draws distinction between ordinary accesses <strong>and</strong> synchronizations.<br />

A program obeys Data-Race-Free-0 if, for any sequentially consistent execution, all con icting<br />

memory accesses are ordered by the transitive relation <strong>of</strong> program order <strong>and</strong> synchronization<br />

order. Data-Race-Free-1 [3] furthermore characterizes paired synchronizations as acquire <strong>and</strong><br />

release operations. The Properly-Labeled programs [46, 47] can classify competing accesses<br />

as loop <strong>and</strong> non-loop accesses, requiring the identi cation <strong>of</strong> a common class <strong>of</strong> synchroniza-<br />

tion accesses where one processor repeatedly reads a location until another processor writes a<br />

particular value to that location.<br />

Dag consistency [17, 18] is a memory model that is de ned on the directed acyclic graph<br />

(dag) <strong>of</strong> user-level threads that make up a parallel computation. Intuitively, each thread ob-<br />

19

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

Saved successfully!

Ooh no, something went wrong!