Library Abstraction for C/C++ Concurrency

被引:37
|
作者
Batty, Mark [1 ]
Dodds, Mike [2 ]
Gotsman, Alexey
机构
[1] Univ Cambridge, Cambridge CB2 1TN, England
[2] Univ York, York YO10 5DD, N Yorkshire, England
基金
英国工程与自然科学研究理事会;
关键词
Languages; Theory; Verification; Concurrency; Modularity; C; C plus;
D O I
10.1145/2480359.2429099
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
When constructing complex concurrent systems, abstraction is vital: programmers should be able to reason about concurrent libraries in terms of abstract specifications that hide the implementation details. Relaxed memory models present substantial challenges in this respect, as libraries need not provide sequentially consistent abstractions: to avoid unnecessary synchronisation, they may allow clients to observe relaxed memory effects, and library specifications must capture these. In this paper, we propose a criterion for sound library abstraction in the new C11 and C++11 memory model, generalising the standard sequentially consistent notion of linearizability. We prove that our criterion soundly captures all client-library interactions, both through call and return values, and through the subtle synchronisation effects arising from the memory model. To illustrate our approach, we verify implementations against specifications for the lock-free Treiber stack and a producer-consumer queue. Ours is the first approach to compositional reasoning for concurrent C11/C++11 programs.
引用
收藏
页码:235 / 248
页数:14
相关论文
共 50 条
  • [1] CONCURRENCY ANNOTATIONS IN C++
    BAQUERO, C
    MOURA, F
    [J]. SIGPLAN NOTICES, 1994, 29 (07): : 61 - 67
  • [2] Standard C/C++: Testing C++ library conformance
    Plauger, P.J.
    [J]. C/C++ Users Journal, 2000, 18 (04):
  • [3] Effective Stateless Model Checking for C/C++ Concurrency
    Kokologiannakis, Michalis
    Lahav, Ori
    Sagonas, Konstantinos
    Vafeiadis, Viktor
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2 (02):
  • [4] Abstraction and the C++ machine model
    Stroustrup, B
    [J]. EMBEDDED SOFTWARE AND SYSTEMS, 2005, 3605 : 1 - 13
  • [5] Foundations of the C++ concurrency memory model
    Boehm, Hans-J.
    Adve, Sarita V.
    [J]. ACM SIGPLAN NOTICES, 2008, 43 (06) : 68 - 78
  • [6] ABC++- CONCURRENCY BY INHERITANCE IN C++
    ARJOMANDI, E
    OFARRELL, W
    KALAS, I
    KOBLENTS, G
    EIGLER, FC
    GAO, GR
    [J]. IBM SYSTEMS JOURNAL, 1995, 34 (01) : 120 - 137
  • [7] A CONCURRENCY-CONTROL MECHANISM FOR C++ OBJECTS
    SALEH, H
    GAUTRON, P
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1992, 612 : 195 - 210
  • [8] Clarifying and Compiling C/C++ Concurrency: from C++11 to POWER
    Batty, Mark
    Memarian, Kayvan
    Owens, Scott
    Sarkar, Susmit
    Sewell, Peter
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (01) : 509 - 520
  • [9] MU-C++ - CONCURRENCY IN THE OBJECT-ORIENTED LANGUAGE C++
    BUHR, PA
    DITCHFIELD, G
    STROOBOSSCHER, RA
    YOUNGER, BM
    ZARNKE, CR
    [J]. SOFTWARE-PRACTICE & EXPERIENCE, 1992, 22 (02): : 137 - 172
  • [10] Standard C++ library redux
    不详
    [J]. IEEE SPECTRUM, 1996, 33 (05) : 81 - 82