arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1610.08843cs.PLcs.LO
收藏

Fencing Off Go:Liveness and Safety for Recommended Programming(英语:Fencing Off Go:Liveness and Safety for Recommended Programming)

Fencing off Go: Liveness and Safety for Channel-based Programming (extended version)

Julien Lange, Nicholas Ng, Bernardo Toninho, Nobuko Yoshida

摘要:

Go是一种生产级静态类型的程序设计语言,其设计特点是显式的消息传递原语和轻量级线程,使(并鼓励)程序员能够开发并发系统,其中组件通过通信进行交互,而不是基于锁的共享内存并发。Go语言只能在运行时检测全局死锁,但不能提供编译时保护来防止所有常见的通信不匹配或部分死锁。这项工作开发了一个静态验证框架,在Go程序的活性和安全性,能够检测通信错误和部分死锁在一般类的现实并发程序,包括那些与动态通道创建,无限线程创建和递归。我们的方法从Go程序中推断出其通信模式作为行为类型的忠实表示。通过检查通道使用的语法限制,被称为围栏,我们确保程序是由许多不同的通信模式,可以重复无限多次。这个限制允许我们实现过程来检查类型中的活性和安全性,这反过来又近似于Go程序中的活性和安全性。我们已经在一个工具链中实现了类型推断、活性和安全检查,并在公开的Go程序中进行了测试。注:这是POPL 2017中发表的一篇论文的修订扩展版本,详情请参见第13页。

英文摘要:

Go is a production-level statically typed programming language whose design features explicit message-passing primitives and lightweight threads, enabling (and encouraging) programmers to develop concurrent systems where components interact through communication more so than by lock-based shared memory concurrency. Go can only detect global deadlocks at runtime, but provides no compile-time protection against all too common communication mismatches or partial deadlocks. This work develops a static verification framework for liveness and safety in Go programs, able to detect communication errors and partial deadlocks in a general class of realistic concurrent programs, including those with dynamic channel creation, unbounded thread creation and recursion. Our approach infers from a Go program a faithful representation of its communication patterns as a behavioural type. By checking a syntactic restriction on channel usage, dubbed fencing, we ensure that programs are made up of finitely many different communication patterns that may be repeated infinitely many times. This restriction allows us to implement procedures to check for liveness and safety in types which in turn approximates liveness and safety in Go programs. We have implemented a type inference and liveness and safety checks in a tool-chain and tested it against publicly available Go programs. Note: This is a revised extended version of a paper that appeared in POPL 2017, see page 13 for details.

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

↑