In the past decades, many different programming models for managing concurrency in applications have been proposed, such as the actor model, Communicating Sequential Processes, and Software Transactional Memory. The ubiquity of multi-core processors has made harnessing concurrency even more important. We observe that modern languages, such as Scala, Clojure, or F#, provide not one, but multiple concurrency models that help developers manage concurrency. Large end-user applications are rarely built using just a single concurrency model. Programmers need to manage a responsive UI, deal with file or network I/O, asynchronous workflows, and shared resources. Different concurrency models facilitate different requirements. This raises the issue of how these concurrency models interact, and whether they are composable. After all, combining different concurrency models may lead to subtle bugs or inconsistencies. In this paper, we perform an in-depth study of the concurrency abstractions provided by the Clojure language. We study all pairwise combinations of the abstractions, noting which ones compose without issues, and which do not. We make an attempt to abstract from the specifics of Clojure, identifying the general properties of concurrency models that facilitate or hinder composition.
翻译:在过去几十年中,提出了许多管理应用程序中同值货币的不同编程模式,例如行为者模型、通信序列进程和软件交易内存。多核心处理器的普遍存在使得利用同值货币变得更加重要。我们发现,现代语言,如Scala、Clojure或F#,不是提供一种,而是提供多种同值货币模型,帮助开发商管理同值货币。大型终端用户应用程序很少仅仅使用单一同值货币模型来建立。程序设计者需要管理一个反应灵敏的UI、处理文件或网络 I/O、非同步工作流程和共享资源。不同的同值货币模型促进了不同的要求。这提出了这些同值货币模型如何互动以及它们是否可复写的问题。毕竟,将不同的同值货币模型结合起来可能会导致微妙的错误或不一致。在本文中,我们深入研究了Clojure语言提供的同值货币抽象抽象抽象模型。我们研究了各种抽象的组合,指出哪些是没有问题,哪些是非同步的工作流程,哪些是非同步的。我们试图从一般的模型中找出一个抽象的构成。