🤖 AI Summary
This study addresses the problem of determining whether an observed execution trace of a multithreaded program admits a sequentially consistent interleaving under a constraint of at most π preemptions. By integrating computational complexity theory with parameterized analysis, the work establishes the first trichotomy in complexity based on the number of writers: the single-writer case is polynomial-time decidable; the two-writer case is NP-hard; and the three-writer case admits a conditional lower bound under the Exponential Time Hypothesis. Moreover, the problem becomes W[1]-hard when the number of preemptions is unbounded. This paper presents the first fixed-parameter intractability result parameterized by the number of preemptions, thereby delineating precise computational boundaries for reasoning about sequential consistency under limited preemption.
📝 Abstract
Gibbons and Korach studied a fundamental problem in 1997: given an observed sequence of reads and writes of a multi-threaded program, does there exist an interleaving which is sequentially consistent? Apart from applications in testing shared memory implementations, a procedure for this problem is employed in Dynamic Partial-Order-Reduction (DPOR) algorithms. The problem is known to be NP-hard even when different syntactic parameters are kept bounded. In this paper, we consider a restriction on the kind of interleaving required: does there exist a sequentially-consistent interleaving with at most π preemptions? Empirical evidence suggests that several bugs manifest within a few preemptive switches. This motivates us to investigate the problem under bounded preemptions. Our results exhibit a trichotomy: the problem lends to a polynomial-time algorithm for the class of single-writer programs where for each variable, there is a single thread writing to it; it becomes NP-hard for two-writer programs and finally, for three-writer programs, we get a conditional lower bound under the Exponential-Time-Hypothesis. When the number of preemptions π is not bounded, we show the problem to be W[1]-hard, and hence unlikely to be fixed-parameter-tractable with parameter π.