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.
翻译:实现并发数据结构具有挑战性,需要深入理解并发概念和精心设计以确保正确性、性能和可扩展性。此外,组合两个或多个并发数据结构的操作通常需要同步封装器来确保操作原子性地一起应用,这会导致序列化,从而放弃单个数据结构的性能优势。数据库管理系统(DBMS)提供了通用的并发控制(CC),非常适合实现并发数据结构。然而,DBMS对此用例过于泛化,无法匹敌专用实现的性能。本文提出了声明式并发数据结构(DCDS)框架,用于从串行规范自动生成并发数据结构。在DCDS中,用户在设计时通过嵌入式领域特定语言(DSL)声明所需数据结构的属性和方法。DCDS在构建时自动注入并发控制,生成编译为机器码的并发中间表示(IR)。用于设计数据结构的声明式接口通过协同优化组件结构实现高效可组合性;优化同时应用于组合后的串行规范和生成的并发IR。我们在原型系统Rosti中实现了DCDS框架,并通过实验表明,在Rosti中声明的数据结构可以通过协同优化其逻辑功能和生成的并发控制协议实现高效组合。评估结果显示,与开源库相比,在Rosti中组合映射和列表以创建LRU容器可获得高达2倍的性能可扩展性。通过将DCDS与内存数据库管理系统Proteus进行比较,展示了其作为进程内联机事务处理(OLTP)的适用性,性能提升高达2倍。