Skip to main content
QUICK REVIEW

[论文解读] Quantitative Synthesis for Concurrent Programs

Pavol Černý, Krishnendu Chatterjee|arXiv (Cornell University)|Apr 21, 2011
Formal Methods in Verification参考文献 16被引用 58
一句话总结

本文提出了一种并发程序的定量综合框架,通过自动解析非确定性同步选择,生成正确且性能最优的程序。该框架通过加权自动机建模系统级开销,并将综合问题简化为具有定量目标的二人博弈,实现NEXP完全复杂度,同时支持对实际架构和工作负载的高效综合。

ABSTRACT

We present an algorithmic method for the quantitative, performance-aware synthesis of concurrent programs. The input consists of a nondeterministic partial program and of a parametric performance model. The nondeterminism allows the programmer to omit which (if any) synchronization construct is used at a particular program location. The performance model, specified as a weighted automaton, can capture system architectures by assigning different costs to actions such as locking, context switching, and memory and cache accesses. The quantitative synthesis problem is to automatically resolve the nondeterminism of the partial program so that both correctness is guaranteed and performance is optimal. As is standard for shared memory concurrency, correctness is formalized "specification free", in particular as race freedom or deadlock freedom. For worst-case (average-case) performance, we show that the problem can be reduced to 2-player graph games (with probabilistic transitions) with quantitative objectives. While we show, using game-theoretic methods, that the synthesis problem is NEXP-complete, we present an algorithmic method and an implementation that works efficiently for concurrent programs and performance models of practical interest. We have implemented a prototype tool and used it to synthesize finite-state concurrent programs that exhibit different programming patterns, for several performance models representing different architectures.

研究动机与目标

  • 为填补现有综合框架在性能建模与正确性保证方面存在的空白,提出结合定量性能建模与正确性保障的综合方法。
  • 实现对部分并发程序中非确定性同步选择的自动解析。
  • 提供一个参数化性能模型,以捕捉锁、上下文切换和内存访问模式等架构开销。
  • 将正确性形式化为无数据竞争或无死锁,而无需显式规格说明。
  • 开发一种可扩展至实际并发编程模式的高效算法方法。

提出的方法

  • 该方法使用加权自动机对性能进行建模,为锁、上下文切换和内存访问等低级操作分配开销。
  • 将定量综合问题简化为具有定量目标的二人图博弈,其中一名玩家解析非确定性,另一名玩家控制调度器。
  • 针对最坏情况和平均情况性能,采用具有概率转移的博弈论模型进行形式化。
  • 该框架支持参数化性能模型,可编码缓存效应、内存层次结构开销和架构特性。
  • 一个原型工具实现了综合算法,并在真实世界的并发编程模式上进行了评估。
  • 该方法利用博弈论技术证明了NEXP完全性,并指导对正确且最优策略的高效搜索。

实验结果

研究问题

  • RQ1我们能否生成在参数化性能模型下既正确又最优的并发程序?
  • RQ2如何在形式化综合框架中建模架构性能特征,如缓存效应和锁开销?
  • RQ3在定量目标下,综合正确且高性能的并发程序的计算复杂度是多少?
  • RQ4我们能否高效地将综合过程扩展到具有真实性能模型的实际并发编程模式?
  • RQ5在不同架构假设下,不同的同步策略(如全局锁与局部锁)如何影响性能?

主要发现

  • 综合算法成功为生产者-消费者模式生成了最优并发程序,在高锁开销条件下,全局锁的性能比单元格局部锁高出3倍。
  • 在乐观并发控制场景中,工具自动推导出在回写前应执行的最优操作数,有效平衡了重试开销与写入频率。
  • 在工作分担场景中,工具根据初始化开销和总工作量,识别出最优线程数,表明尽管存在更高开销,对于较大工作负载而言,更多线程的性能优于更少线程。
  • 在缓存感知性能模型中,将临界段内操作数从n=1增加到n=5,性能提升了2.32倍,归因于更好的时间局部性。
  • 性能模型成功捕捉了架构效应,如缓存行行为,其中WRITE和READ操作根据缓存状态被赋予不同的开销。
  • 原型工具展示了良好的可扩展性与实用性,在多种并发模式和性能模型下均能生成正确且高效的程序。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。