线程库的上下文限定验证
Context-Bounded Verification of Thread Pools
摘要:
线程池是一种常见的编程习惯用法,其中维护一组固定的工作线程以并发执行任务。工人们反复挑选任务,并将其完成。每个任务都是顺序的,可能有递归代码,任务通过共享内存进行通信。执行一个任务可能会导致产生更多的新任务。我们考虑线程池程序的安全验证问题。我们用两个参数来描述这个问题:线程池的大小以及每个任务的上下文切换次数。线程池的大小决定了并发运行的工作线程的数量。上下文切换的数量决定了在执行单个任务时工作者可以被换出的次数-就像多线程递归程序的许多验证问题一样,上下文绑定对于可判定性很重要。我们表明,线程池,上下文有界的,布尔程序的安全验证问题是EXPSPACE完全的,即使线程池的大小和上下文的界限是在二进制。我们的主要结果,EXPSPACE上界,是使用一系列新的简洁的编码技术的独立语言理论的兴趣。特别是,我们展示了一个多项式时间的结构,简洁的下推自动机作为双简洁的非确定性有限自动机接受的语言的向下闭包。虽然接受向下闭包的非确定有限自动机的大小存在显式的双指数下界,但我们的结果表明这些自动机可以被压缩。我们表明,线程池显着降低了计算能力:相比之下,如果只有上下文绑定提供的二进制,但没有线程池,安全验证问题成为3EXPSPACE完成。
英文摘要:
Thread pooling is a common programming idiom in which a fixed set of worker threads are maintained to execute tasks concurrently. The workers repeatedly pick tasks and execute them to completion. Each task is sequential, with possibly recursive code, and tasks communicate over shared memory. Executing a task can lead to more new tasks being spawned. We consider the safety verification problem for thread-pooled programs. We parameterize the problem with two parameters: the size of the thread pool as well as the number of context switches for each task. The size of the thread pool determines the number of workers running concurrently. The number of context switches determines how many times a worker can be swapped out while executing a single task - like many verification problems for multithreaded recursive programs, the context bounding is important for decidability. We show that the safety verification problem for thread-pooled, context-bounded, Boolean programs is EXPSPACE-complete, even if the size of the thread pool and the context bound are given in binary. Our main result, the EXPSPACE upper bound, is derived using a sequence of new succinct encoding techniques of independent language-theoretic interest. In particular, we show a polynomial-time construction of downward closures of languages accepted by succinct pushdown automata as doubly succinct nondeterministic finite automata. While there are explicit doubly exponential lower bounds on the size of nondeterministic finite automata accepting the downward closure, our result shows these automata can be compressed. We show that thread pooling significantly reduces computational power: in contrast, if only the context bound is provided in binary, but there is no thread pooling, the safety verification problem becomes 3EXPSPACE-complete.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。