Bestow和Atomic:使用隔离、委托和代理的并发编程
Bestow and Atomic: Concurrent Programming using Isolation, Delegation and Grouping
摘要:
任何非平凡的并发系统都保证同步,而不管并发模型如何。基于Actor的并发性通过异步消息传递将Actor中的所有计算序列化。相比之下,基于锁的并发通过遵循锁-解锁协议访问某些数据来串行化某些计算。这两个系统都需要对指针和别名进行合理的推理,以排除数据竞争。如果参与者隔离被破坏,那么单线程控制抽象也会被破坏。同样,对于锁,如果可以在锁的作用域之外访问数据,则该数据不受锁的控制。在本文中,我们将讨论如何平衡混叠和同步。在前面的工作中,我们定义了一个类型系统,它保证了基于参与者的并发和基于锁的并发的数据竞争自由。本文通过引入两个编程结构来扩展这项工作;一个用于解耦隔离和同步,另一个用于从较低级别的同步构建更高级别的原子性保证。我们主要关注参与者,特别是Encore程序设计语言,但我们的最终目标是以这样一种方式定义我们的构造,即它们可以与锁和参与者一起使用,因为这两种模型的组合在实际系统中经常发生。我们讨论了设计空间,提供了几种不同的语义形式化,并讨论了它们的属性,并将它们连接到案例研究中,展示了我们提出的构造是如何有用的。我们还报告了一个正在进行的实施,我们提出的结构在安可。
英文摘要:
Any non-trivial concurrent system warrants synchronisation, regardless of the concurrency model. Actor-based concurrency serialises all computations in an actor through asynchronous message passing. In contrast, lock-based concurrency serialises some computations by following a lock--unlock protocol for accessing certain data. Both systems require sound reasoning about pointers and aliasing to exclude data-races. If actor isolation is broken, so is the single-thread-of-control abstraction. Similarly for locks, if a datum is accessible outside of the scope of the lock, the datum is not governed by the lock. In this paper we discuss how to balance aliasing and synchronisation. In previous work, we defined a type system that guarantees data-race freedom of actor-based concurrency and lock-based concurrency. This paper extends this work by the introduction of two programming constructs; one for decoupling isolation and synchronisation and one for constructing higher-level atomicity guarantees from lower-level synchronisation. We focus predominantly on actors, and in particular the Encore programming language, but our ultimate goal is to define our constructs in such a way that they can be used both with locks and actors, given that combinations of both models occur frequently in actual systems. We discuss the design space, provide several formalisations of different semantics and discuss their properties, and connect them to case studies showing how our proposed constructs can be useful. We also report on an on-going implementation of our proposed constructs in Encore.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。