arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1704.03094cs.PL
收藏

无国界行动者:被监禁国家的大赦

Actors without Borders: Amnesty for Imprisoned State

Elias Castegren, Tobias Wrigstad

摘要:

在并发系统中,通常需要某种形式的同步来实现数据竞争自由,这对正确性和安全性很重要。在基于参与者的系统中,消息是并发交换的,但由接收参与者顺序执行。通过依赖隔离和非共享,参与者可以访问自己的状态而不必担心数据竞争,并且参与者的内部行为可以按顺序进行推理。但是,参与者隔离有时太强,无法表达有用的模式。例如,让数据集合的迭代器别名集合的内部结构允许比每次访问都需要通过集合的接口更有效的实现。在完全隔离的情况下,为了保持顺序推理,迭代器必须成为集合的一部分,这会使集合的接口膨胀,并意味着客户端必须访问整个数据集合才能使用迭代器。在本文中,我们提出了一个程序设计语言的结构,使放松隔离,但不牺牲顺序推理。我们正式的机制,在一个简单的λ演算与演员和被动对象,并显示如何演员可能会泄漏其内部状态的一部分,同时确保与此数据的任何交互仍然是同步的。

英文摘要:

In concurrent systems, some form of synchronisation is typically needed to achieve data-race freedom, which is important for correctness and safety. In actor-based systems, messages are exchanged concurrently but executed sequentially by the receiving actor. By relying on isolation and non-sharing, an actor can access its own state without fear of data-races, and the internal behavior of an actor can be reasoned about sequentially. However, actor isolation is sometimes too strong to express useful patterns. For example, letting the iterator of a data-collection alias the internal structure of the collection allows a more efficient implementation than if each access requires going through the interface of the collection. With full isolation, in order to maintain sequential reasoning the iterator must be made part of the collection, which bloats the interface of the collection and means that a client must have access to the whole data-collection in order to use the iterator. In this paper, we propose a programming language construct that enables a relaxation of isolation but without sacrificing sequential reasoning. We formalise the mechanism in a simple lambda calculus with actors and passive objects, and show how an actor may leak parts of its internal state while ensuring that any interaction with this data is still synchronised.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑