There is an ongoing effort to provide programming abstractions that ease the burden of exploiting multicore hardware. Many programming abstractions (e.g., concurrent objects, transactional memory, etc.) simplify matters, but still involve intricate engineering. We argue that some difficulty of multicore programming can be meliorated through a declarative programming style in which programmers directly express the independence of fragments of sequential programs. In our proposed paradigm, programmers write programs in a familiar, sequential manner, with the added ability to explicitly express the conditions under which code fragments sequentially commute. Putting such commutativity conditions into source code offers a new entry point for a compiler to exploit the known connection between commutativity and parallelism. We give a semantics for the programmer's sequential perspective and, under a correctness condition, find that a compiler-transformed parallel execution is equivalent to the sequential semantics. Serializability/linearizability are not the right fit for this condition, so we introduce scoped serializability and show how it can be enforced with lock synthesis techniques. We next describe a technique for automatically verifying and synthesizing commute conditions via a new reduction from our commute blocks to logical specifications, upon which symbolic commutativity reasoning can be performed. We implemented our work in a new language called Veracity, implemented in Multicore OCaml. We show that commutativity conditions can be automatically generated across a variety of new benchmark programs, confirm the expectation that concurrency speedups can be seen as the computation increases, and apply our work to a small in-memory filesystem and an adaptation of a crowdfund blockchain smart contract.
翻译:目前正在努力提供编程抽象,以减轻利用多核心硬件的负担。许多编程抽象(例如,同时对象、交易记忆等)简化了事项,但仍涉及复杂的工程。我们争辩说,多核心编程的某些困难可以通过宣示性编程风格加以缓解,程序员在这种风格中直接表达相继程序碎块的独立性。在我们提议的范式中,程序员以熟悉、顺序的方式编写程序,增加能力以明确表达代码依次转换的电路条条条条条数的条件。在源码中应用这种集成性条件为编程者提供了一个新的进入点,以利用已知的通气和平行关系之间的联系。我们提出,对于多核心编程编程的某些困难可以通过宣讲一个智能切入点,对于编程的顺序视角,在正确的条件下,程序编译的平行执行相当于顺序的顺序。在编程中,编程/线条线性程序不适合于这种状态,因此我们引入了范围的串联,并展示如何用锁合成技术来实施它。我们接下来描述了一种在正轨流程中自动核实和升级的预期技术,在不断更新的节路路路路路路路路段中进行。