上下文锁定下的可达性
Reachability under Contextual Locking
摘要:
多线程程序的成对可达性问题询问,给定两个线程中的控制位置,它们是否可以在程序的执行中同时到达。该问题对于静态分析很重要,用于检测并发启用的语句。这个问题通常是不可判定的,即使当数据被抽象化,并且当线程(使用递归)仅使用有限的锁集进行同步时。流行的编程范例,限制锁的使用模式已被确定的成对可达性问题成为可判定的。在本文中,我们考虑了一个新的自然编程范式,称为上下文锁定,它将锁的使用绑定到每个线程中的调用模式:我们假设锁在相同的上下文中被释放,它们被收购,并且在过程调用中线程获得的每个锁在过程返回之前被释放。我们的主要结果是,成对的可达性问题是多项式时间判定的这种新的编程范式以及。如果锁是可重入的,则问题变得不可判定;可重入锁是一种\emph{recursive locking}机制,它允许多线程程序中的线程多次获取可重入锁。
英文摘要:
The pairwise reachability problem for a multi-threaded program asks, given control locations in two threads, whether they can be simultaneously reached in an execution of the program. The problem is important for static analysis and is used to detect statements that are concurrently enabled. This problem is in general undecidable even when data is abstracted and when the threads (with recursion) synchronize only using a finite set of locks. Popular programming paradigms that limit the lock usage patterns have been identified under which the pairwise reachability problem becomes decidable. In this paper, we consider a new natural programming paradigm, called contextual locking, which ties the lock usage to calling patterns in each thread: we assume that locks are released in the same context that they were acquired and that every lock acquired by a thread in a procedure call is released before the procedure returns. Our main result is that the pairwise reachability problem is polynomial-time decidable for this new programming paradigm as well. The problem becomes undecidable if the locks are reentrant; reentrant locking is a \emph{recursive locking} mechanism which allows a thread in a multi-threaded program to acquire the reentrant lock multiple times.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。