[论文解读] From Sequential to Concurrent: Correctness and Relative Efficiency
本文提出了一种与同步技术无关的正确性准则,以公平比较乐观(事务性)和悲观(锁)并发控制。它表明,在某些工作负载下,悲观锁的性能可优于事务;在其他工作负载下,事务的性能可优于锁;而将两者结合可实现严格更高的并发性——该结论通过一个最优且可扩展的基于列表的集合算法得到验证。
Modern concurrent programming benefits from a large variety of synchronization techniques. These include conventional pessimistic locking, as well as optimistic techniques based on conditional synchronization primitives or transactional memory. Yet, it is unclear which of these approaches better leverage the concurrency inherent to multi-cores. In this paper, we compare the level of concurrency one can obtain by converting a sequential program into a concurrent one using optimistic or pessimistic techniques. To establish fair comparison of such implementations, we introduce a new correctness criterion for concurrent programs, defined independently of the synchronization techniques they use. We treat a program's concurrency as its ability to accept a concurrent schedule, a metric inspired by the theories of both databases and transactional memory. We show that pessimistic locking can provide strictly higher concurrency than transactions for some applications whereas transactions can provide strictly higher concurrency than pessimistic locks for others. Finally, we show that combining the benefits of the two synchronization techniques can provide strictly more concurrency than any of them individually. We propose a list-based set algorithm that is optimal in the sense that it accepts all correct concurrent schedules. As we show via experimentation, the optimality in terms of concurrency is reflected by scalability gains.
研究动机与目标
- 建立并发编程中乐观与悲观同步技术之间的公平比较。
- 为并发程序定义一种与特定同步机制无关的正确性准则。
- 评估并量化不同同步策略可实现的并发级别。
- 设计并实现一种并发列表集合算法,以最大化正确并发调度的接受度。
- 证明结合乐观与悲观技术可实现高于单独使用任一技术的并发性。
提出的方法
- 基于并发调度接受度提出一种正确性准则,受数据库和事务内存理论的启发。
- 使用形式化模型比较顺序、悲观锁和事务性实现之间的并发级别。
- 提出一种列表集合算法,旨在接受所有正确的并发调度,实现最优并发性。
- 在多核系统上进行实验评估,以测量可扩展性和并发性提升。
- 采用并发性作为程序可接受的有效并发调度数量的度量标准。
- 采用结合悲观锁与事务内存的混合方法,以超越单一技术的并发性。
实验结果
研究问题
- RQ1对于某些应用,悲观锁是否可提供高于事务内存的并发性?
- RQ2对于某些应用,事务内存是否可提供高于悲观锁的并发性?
- RQ3是否存在一种组合同步技术,可实现严格高于单独使用乐观或悲观方法的并发性?
- RQ4能否设计一种并发数据结构,以接受所有正确的并发调度,从而实现最优并发性?
- RQ5并发性最优在多核系统上在多大程度上转化为可扩展性提升?
主要发现
- 对于某些工作负载(如高写入竞争场景),悲观锁可实现严格高于事务内存的并发性。
- 对于其他工作负载(尤其是低竞争和细粒度访问模式),事务内存可实现严格高于悲观锁的并发性。
- 结合两种技术可实现严格高于单独使用任一技术的并发性。
- 所提出的基于列表的集合算法是最优的,因为它接受了所有正确的并发调度,展示了并发性的理论上限。
- 实验结果表明,并发性最优性在多核架构上可转化为可测量的可扩展性提升。
- 本研究确立了将并发性(以调度接受度衡量)作为比较同步技术的有意义且可量化的指标。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。