论文标题
真实性:声明性的多核心编程和通勤性
Veracity: Declarative Multicore Programming with Commutativity
论文作者
论文摘要
持续不断的努力来提供编程抽象,以减轻利用多项硬件的负担。许多编程摘要(例如并发对象,交易内存等)简化了问题,但仍然涉及复杂的工程。我们认为,可以通过声明性的编程风格来融化多项编程的某些困难,在这种方式中,程序员直接表达了顺序程序片段的独立性。 在我们提出的范式中,程序员以熟悉的,顺序的方式编写程序,并具有显式表达代码片段顺序通勤的条件的增加能力。将这种通勤条件放入源代码中,为编译器提供了一个新的切入点,以利用通勤性和并行性之间的已知联系。我们为程序员的顺序透视图提供了语义,并且在正确的条件下,发现编译器转换的并行执行等效于顺序语义。序列化/线性化性不适合此条件,因此我们引入了示波器的序列化性,并显示如何使用锁定合成技术来执行它。 接下来,我们描述了一种通过从通勤块到逻辑规范的新降低来自动验证和合成通勤条件的技术,可以在其上执行符号通勤推理。我们以一种名为“ Quinacity”的新语言实施了我们的工作,该语言在多核OCAML中实现。我们表明,可以在各种新的基准计划中自动生成通勤性条件,并确认可以将并发加速速度视为随着计算的增加而被视为,并将我们的工作应用于小型内存文件系统以及对Crowdfund Blockfund Blockchain智能合同的改编。
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.