A tree clock data structure for causal orderings in concurrent executions
Umang Mathur, Andreas Pavlogiannis, Hünkar Can Tunç, Mahesh Viswanathan
Abstract
Dynamic techniques are a scalable and effective way to analyze concurrent programs. Instead of analyzing all behaviors of a program, these techniques detect errors by focusing on a single program execution. Often a crucial step in these techniques is to define a causal ordering between events in the execution, which is then computed using vector clocks, a simple data structure that stores logical times of threads. The two basic operations of vector clocks, namely join and copy, require Θ(𝑘) time, where 𝑘 is the number of threads. Thus they are a computational bottleneck when 𝑘 is large.
In this work, we introduce tree clocks, a new data structure that replaces vector clocks for computing causal orderings in program executions. Joining and copying tree clocks takes time that is roughly proportional to the number of entries being modified, and hence the two operations do not suffer the a-priori Θ(𝑘) cost per application. We show that when used to compute the classic happens-before (HB) partial order, tree clocks are optimal, in the sense that no other data structure can lead to smaller asymptotic running time. Moreover, we demonstrate that tree clocks can be used to compute other partial orders, such as schedulable-happens-before (SHB) and the standard Mazurkiewicz (MAZ) partial order, and thus are a versatile data structure. Our experiments show that just by replacing vector clocks with tree clocks, the computation becomes from 2.02× faster (MAZ) to 2.66× (SHB) and 2.97× (HB) on average per benchmark. These results illustrate that tree clocks have the potential to become a standard data structure with wide applications in concurrent analyses.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f21df353-b57d-4540-80c5-49094fa8ad94Cited by top-tier papers8
- Predictive Monitoring against Pattern Regular LanguagesZhendong Ang, Umang MathurPOPL 2024 · 12 citations
- Dynamic Race Detection with O(1) SamplesMosaad Al Thokair, Minjian Zhang, Umang Mathur, Mahesh ViswanathanPOPL 2023 · 9 citations
- Optimistic Prediction of Synchronization-Reversal Data RacesZheng Shi, Umang Mathur, Andreas PavlogiannisICSE 2024 · 8 citations
- CSSTs: A Dynamic Data Structure for Partial Orders in Concurrent Execution AnalysisHünkar Can Tunç, Ameya Prashant Deshmukh, Berk Çirisci, Constantin Enea et al.ASPLOS 2024 · 6 citations
- AWDIT: An Optimal Weak Database Isolation TesterLasse Møldrup, Andreas PavlogiannisPLDI 2025 · 5 citations
Builds on6
- Fast, sound, and effectively complete dynamic race predictionAndreas PavlogiannisPOPL 2020 · 46 citations
- Optimal prediction of synchronization-preserving racesUmang Mathur, Andreas Pavlogiannis, Mahesh ViswanathanPOPL 2021 · 36 citations
- SmartTrack: efficient predictive race detectionJake Roemer, Kaan Genç, Michael D. BondPLDI 2020 · 28 citations
- The Complexity of Dynamic Data Race PredictionUmang Mathur, Andreas Pavlogiannis, Mahesh ViswanathanLICS 2020 · 27 citations
- Atomicity Checking in Linear Time using Vector ClocksUmang Mathur, Mahesh ViswanathanASPLOS 2020 · 27 citations
Related papers
- Efficient Timestamping for Sampling-Based Race DetectionMinjian Zhang, Daniel Wee Soong Lim, Mosaad Al Thokair, Umang Mathur et al.PLDI 2025 · 1 citation
- Unblocking Dynamic Partial Order ReductionMichalis Kokologiannakis, Iason Marmanis, Viktor VafeiadisCAV 2023 · 7 citations
- Predictive Monitoring with Strong Trace PrefixesZhendong Ang, Umang MathurCAV 2024 · 3 citations
- Efficient Predictive Monitoring of Message Passing Interface ProgramsJiaqiang Yao, Haocheng Geng, Zhenbang ChenISSTA 2026
- Detecting concurrency vulnerabilities based on partial orders of memory and thread eventsKunpeng Yu, Chenxu Wang, Yan Cai, Xiapu Luo et al.FSE 2021 · 9 citations
