Title
Synchronising C/C++ and POWER
Abstract
Shared memory concurrency relies on synchronisation primitives: compare-and-swap, load-reserve/store-conditional (aka LL/SC), language-level mutexes, and so on. In a sequentially consistent setting, or even in the TSO setting of x86 and Sparc, these have well-understood semantics. But in the very relaxed settings of IBM®, POWER®, ARM, or C/C++, it remains surprisingly unclear exactly what the programmer can depend on. This paper studies relaxed-memory synchronisation. On the hardware side, we give a clear semantic characterisation of the load-reserve/store-conditional primitives as provided by POWER multiprocessors, for the first time since they were introduced 20 years ago; we cover their interaction with relaxed loads, stores, barriers, and dependencies. Our model, while not officially sanctioned by the vendor, is validated by extensive testing, comparing actual implementation behaviour against an oracle generated from the model, and by detailed discussion with IBM staff. We believe the ARM semantics to be similar. On the software side, we prove sound a proposed compilation scheme of the C/C++ synchronisation constructs to POWER, including C/C++ spinlock mutexes, fences, and read-modify-write operations, together with the simpler atomic operations for which soundness is already known from our previous work; this is a first step in verifying concurrent algorithms that use load-reserve/store-conditional with respect to a realistic semantics. We also build confidence in the C/C++ model in its own terms, fixing some omissions and contributing to the C standards committee adoption of the C++11 concurrency model.
Year
DOI
Venue
2012
10.1145/2254064.2254102
PLDI
Keywords
Field
DocType
store-conditional primitive,paper studies relaxed-memory synchronisation,concurrency model,synchronising c,c standards committee adoption,synchronisation primitive,synchronisation construct,use load-reserve,arm semantics,power multiprocessors,realistic semantics,read modify write,sequential consistency,compare and swap,semantics,shared memory,memory model
Programming language,C dynamic memory allocation,Computer science,Concurrency,Parallel computing,Oracle,Real-time computing,Memory model,Soundness,Allocator,Smart pointer,const
Conference
Volume
Issue
ISSN
47
6
0362-1340
Citations 
PageRank 
References 
36
1.36
12
Authors
8
Name
Order
Citations
PageRank
Susmit Sarkar174430.76
Kayvan Memarian22017.84
Scott Owens368326.50
Mark Batty42039.21
Peter Sewell5144668.16
Luc Maranget680849.83
Jade Alglave760826.53
Derek Williams82309.05