Declarative Concurrent Data Structures (2404.13359v1)
Abstract: Implementing concurrent data structures is challenging and requires a deep understanding of concurrency concepts and careful design to ensure correctness, performance, and scalability. Further, composing operations on two or more concurrent data structures often requires a synchronization wrapper to ensure the operations are applied together atomically, resulting in serialization and, thereby, giving up the performance benefit of the individual data structures. DBMS provides generalized concurrency control (CC) and is a good fit for implementing concurrent data structures. However, DBMSs are over-generalized for this use case, which fails to match the performance of specialized implementations. This paper makes the case for the Declarative Concurrent Data Structures (DCDS) framework for automatically generating concurrent data structures from a serial specification. In DCDS, users declare the attributes and methods needed for their desired data structure through an embedded DSL at design time. DCDS automatically injects CC at build-time, generating a concurrent intermediate representation (IR) compiled into machine code. A declarative interface for designing data structure enables efficient composability through co-optimizing component structures; optimizations are applied to both the composed serial specification and the generated concurrent IR. We realize the DCDS framework in our prototype system Rosti and experimentally show that data structures declared in Rosti can be efficiently composed by co-optimizing their logical functionality and the generated CC protocol. Our evaluation shows that composing a map and a list to create an LRU container can benefit up to 2X performance scalability in Rosti compared to an open-source library. We demonstrate the applicability of DCDS as an in-process OLTP by comparing it with in-memory DBMS, Proteus, and showing up to 2X performance gains.
- 2008. alphaWorks : IBM XL C/C++ for Transactional Memory for AIX : Overview — web.archive.org. https://web.archive.org/web/20110104044951/www.alphaworks.ibm.com/tech/xlcstm/. [Accessed 30-11-2023].
- 2023. https://www.amd.com/en/products/cpu/amd-epyc-9754. [Accessed 01-12-2023].
- 2023a. GitHub - boostorg/boost: Super-project for modularized Boost — github.com. https://github.com/boostorg/boost. [Accessed 30-11-2023].
- 2023b. GitHub - facebook/folly: An open-source C++ library developed and used at Facebook. — github.com. https://github.com/facebook/folly. [Accessed 30-11-2023].
- 2023c. GitHub - oneapi-src/oneTBB: oneAPI Threading Building Blocks (oneTBB) — github.com. https://github.com/oneapi-src/oneTBB. [Accessed 30-11-2023].
- Gene M. Amdahl. 1967. Validity of the single processor approach to achieving large scale computing capabilities. In American federation of information processing societies: Proceedings of the AFIPS ’67 spring joint computer conference, april 18-20, 1967, atlantic city, new jersey, USA (AFIPS conference proceedings), Vol. 30. AFIPS / ACM / Thomson Book Company, Washington D.C., 483–485. https://doi.org/10.1145/1465482.1465560
- Analyzing the Impact of System Architecture on the Scalability of OLTP Engines for High-Contention Workloads. Proc. VLDB Endow. 11, 2 (2017), 121–134. https://doi.org/10.14778/3149193.3149194
- Rudolf Bayer and Mario Schkolnick. 1977. Concurrency of operations on B-trees. Acta Informatica 9 (1977), 1–21. https://doi.org/10.1007/BF00263762 tex.bibsource: dblp computer science bibliography, https://dblp.org tex.timestamp: Sun, 21 Jun 2020 17:37:58 +0200.
- Concurrency Control and Recovery in Database Systems. Addison-Wesley. http://research.microsoft.com/en-us/people/philbe/ccontrol.aspx
- Software transactional memory: why is it only a research toy? Commun. ACM 51, 11 (2008), 40–46. https://doi.org/10.1145/1400214.1400228
- Benchmarking cloud serving systems with YCSB. In Proceedings of the 1st ACM Symposium on Cloud Computing, SoCC 2010, Indianapolis, Indiana, USA, June 10-11, 2010, Joseph M. Hellerstein, Surajit Chaudhuri, and Mendel Rosenblum (Eds.). ACM, 143–154. https://doi.org/10.1145/1807128.1807152
- Transactional locking II. In Distributed computing, 20th international symposium, DISC 2006, stockholm, sweden, september 18-20, 2006, proceedings (Lecture notes in computer science), Shlomi Dolev (Ed.), Vol. 4167. Springer, 194–208. https://doi.org/10.1007/11864219_14
- Stretching transactional memory. In Proceedings of the 2009 ACM SIGPLAN conference on programming language design and implementation, PLDI 2009, dublin, ireland, june 15-21, 2009, Michael Hind and Amer Diwan (Eds.). ACM, 155–165. https://doi.org/10.1145/1542476.1542494
- EPFL DIAS. 2024. Proteus: A Database Engine for Heterogeneous Environments. https://github.com/epfl-dias/proteus. Accessed: 2024-01-30.
- Time-based software transactional memory. IEEE Trans. Parallel Distributed Syst. 21, 12 (2010), 1793–1807. https://doi.org/10.1109/TPDS.2010.49
- Keir Fraser. 2004. Practical lock-freedom. phd. University of Cambridge, UK. https://ethos.bl.uk/OrderDetails.do?uin=uk.bl.ethos.599193
- Intel® C++ STM Compiler, Prototype Edition — web.archive.org. https://web.archive.org/web/20120105053759/http://software.intel.com/en-us/articles/intel-c-stm-compiler-prototype-edition/. [Accessed 30-11-2023].
- Composable memory transactions. Commun. ACM 51, 8 (2008), 91–100. https://doi.org/10.1145/1378704.1378725
- Software transactional memory for dynamic-sized data structures. In Proceedings of the twenty-second ACM symposium on principles of distributed computing, PODC 2003, boston, massachusetts, USA, july 13-16, 2003, Elizabeth Borowsky and Sergio Rajsbaum (Eds.). ACM, 92–101. https://doi.org/10.1145/872035.872048
- Maurice Herlihy and J. Eliot B. Moss. 1993. Transactional Memory: Architectural Support for Lock-Free Data Structures. In Proceedings of the 20th Annual International Symposium on Computer Architecture, San Diego, CA, USA, May 1993, Alan Jay Smith (Ed.). ACM, 289–300. https://doi.org/10.1145/165123.165164
- Maurice Herlihy and Nir Shavit. 2008. The art of multiprocessor programming. Morgan Kaufmann.
- Type-aware transactions for faster concurrent code. In Proceedings of the eleventh european conference on computer systems, EuroSys 2016, london, united kingdom, april 18-21, 2016, Cristian Cadar, Peter R. Pietzuch, Kimberly Keeton, and Rodrigo Rodrigues (Eds.). ACM, 31:1–31:16. https://doi.org/10.1145/2901318.2901348
- Mark D. Hill and Michael R. Marty. 2008. Amdahl’s law in the multicore era. Computer 41, 7 (2008), 33–38. https://doi.org/10.1109/MC.2008.209
- On the efficiency of transactional code generation: A GCC case study. In Symposium on high performance computing systems, WSCAD 2018, são paulo, brazil, october 1-3, 2018. IEEE, 184–190. https://doi.org/10.1109/WSCAD.2018.00037
- C/C++ thread safety analysis. In 14th IEEE international working conference on source code analysis and manipulation, SCAM 2014, victoria, BC, canada, september 28-29, 2014. IEEE Computer Society, 41–46. https://doi.org/10.1109/SCAM.2014.34 tex.bibsource: dblp computer science bibliography, https://dblp.org tex.timestamp: Fri, 24 Mar 2023 00:02:43 +0100.
- Fast Queries Over Heterogeneous Data Through Engine Customization. Proc. VLDB Endow. 9, 12 (2016), 972–983. https://doi.org/10.14778/2994509.2994516
- Algorithmic improvements for fast concurrent Cuckoo hashing. In Ninth Eurosys Conference 2014, EuroSys 2014, Amsterdam, The Netherlands, April 13-16, 2014, Dick C. A. Bulterman, Herbert Bos, Antony I. T. Rowstron, and Peter Druschel (Eds.). ACM, 27:1–27:14. https://doi.org/10.1145/2592798.2592820
- Learning from mistakes: a comprehensive study on real world concurrency bug characteristics. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2008, Seattle, WA, USA, March 1-5, 2008, Susan J. Eggers and James R. Larus (Eds.). ACM, 329–339. https://doi.org/10.1145/1346281.1346323
- Design tradeoffs in modern software transactional memory systems. In Proceedings of the 7th Workshop on languages, compilers, and run-time support for scalable systems, LCR ’04, Houston, Texas, USA, October 22-23, 2004, Alan Cox and Jaspal Subhlok (Eds.). ACM, 15:1–15:7. https://doi.org/10.1145/1066650.1066660
- Virendra J. Marathe and Mark Moir. 2007. Efficient nonblocking software transactional memory. In Proceedings of the 12th ACM SIGPLAN symposium on principles and practice of parallel programming, PPOPP 2007, san jose, california, USA, march 14-17, 2007, Katherine A. Yelick and John M. Mellor-Crummey (Eds.). ACM, 136–137. https://doi.org/10.1145/1229428.1229454
- Robert H. B. Netzer and Barton P. Miller. 1992. What are race conditions? Some issues and formalizations. LOPLAS 1, 1 (1992), 74–88. https://doi.org/10.1145/130616.130623
- Understanding memory and thread safety practices and issues in real-world Rust programs. In Proceedings of the 41st ACM SIGPLAN international conference on programming language design and implementation, PLDI 2020, london, UK, june 15-20, 2020, Alastair F. Donaldson and Emina Torlak (Eds.). ACM, 763–779. https://doi.org/10.1145/3385412.3386036
- Adaptive HTAP through Elastic Resource Scheduling. In Proceedings of the 2020 International Conference on Management of Data, SIGMOD Conference 2020, online conference [Portland, OR, USA], June 14-19, 2020, David Maier, Rachel Pottinger, AnHai Doan, Wang-Chiew Tan, Abdussalam Alawini, and Hung Q. Ngo (Eds.). ACM, 2043–2054. https://doi.org/10.1145/3318464.3389783
- One-shot Garbage Collection for In-memory OLTP through Temporality-aware Version Storage. Proc. ACM Manag. Data 1, 1 (2023), 19:1–19:25. https://doi.org/10.1145/3588699
- James Reinders. 2007. Intel threading building blocks: outfitting C++ for multi-core processor parallelism (1. ed ed.). O’Reilly, Beijing Köln.
- Towards Transactional Memory Support for GCC. Paphos, Cyprus.
- Nir Shavit and Dan Touitou. 1997. Software Transactional Memory. Distributed Comput. 10, 2 (1997), 99–116. https://doi.org/10.1007/S004460050028
- Conflict detection and validation strategies for software transactional memory. In Distributed computing, 20th international symposium, DISC 2006, stockholm, sweden, september 18-20, 2006, proceedings (Lecture notes in computer science), Shlomi Dolev (Ed.), Vol. 4167. Springer, 179–193. https://doi.org/10.1007/11864219_13
- Transactional data structure libraries. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2016, Santa Barbara, CA, USA, June 13-17, 2016, Chandra Krintz and Emery D. Berger (Eds.). ACM, 682–696. https://doi.org/10.1145/2908080.2908112
- Herb Sutter. 2008. Lock-Free Code: A False Sense of Security — drdobbs.com. http://www.drdobbs.com/article/print?articleId=210600279&siteSectionName=cpp. [Accessed 02-12-2023].
- Code generation and optimization for transactional memory constructs in an unmanaged language. In Fifth international symposium on code generation and optimization (CGO 2007), 11-14 march 2007, san jose, california, USA. IEEE Computer Society, 34–48. https://doi.org/10.1109/CGO.2007.4
- An Empirical Evaluation of In-Memory Multi-Version Concurrency Control. Proc. VLDB Endow. 10, 7 (2017), 781–792. https://doi.org/10.14778/3067421.3067427
- Kicking the tires of software transactional memory: why the going gets tough. In SPAA 2008: Proceedings of the 20th annual ACM symposium on parallelism in algorithms and architectures, munich, germany, june 14-16, 2008, Friedhelm Meyer auf der Heide and Nir Shavit (Eds.). ACM, 265–274. https://doi.org/10.1145/1378533.1378582