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.
翻译:线索共享是一个常见的程序编程模式, 固定的工人线条在其中保留固定的一组线条以同时执行任务。 工人反复选择任务, 并执行任务完成。 每个任务都是顺序的, 可能有递归代码, 任务会通过共享的内存进行交流。 执行任务可以导致更多新的任务 。 我们考虑线索共享程序的安全核查问题 。 我们用两个参数来比较问题 : 线索库的大小以及每个任务的背景开关的数量。 线索库的大小决定同时运行的工人数量。 上线库的大小决定着一个任务的数量。 上下文交换器的数量决定了一个工人可以换掉多少次而执行一个单一的任务 - 就像多读的递归代码程序的许多核查问题, 以及任务在共享的记忆中传递到更多新的直线化的自动递归线性递归码 。 我们通过直线线库的大小和上下文框来显示一个不直线的比值。 我们的主要结果, EXPACE 上框是用一个新的直径直径直径直径直的自动递递递缩的自动递缩的自动递化语言的直径直径直径直径直路路路。 。 我们通过直的直径直径直径直的直的直的自动直线的自动递化的自动递化的自动递算算法的自动直线路算算法, 。