SLIDE 1 Verifying Asynchronous programs with nested locks
K Narayan Kumar CMI, Chennai
Joint work with
- M.F. Atig
- A. Bouajjani
- Prakash Saivasan
SLIDE 2 Programs with Locks:
A collection of processes executing concurrently. A finite set of Locks
Proc-1 Proc-2 Proc-3
SLIDE 3 Programs with Locks:
A collection of processes executing concurrently. A finite set of Locks Processes may take locks that are available and release locks that they hold.
Proc-1 Proc-2 Proc-3
SLIDE 4
Programs with Locks:
Our processes will be recursive processes (over finite data domains) Modelled as Pushdown Systems
SLIDE 5
Why Locks
Useful coordination mechanism. Can be built with protocols over shared memory. Usually supported by hardware. Available in many programming languages …
SLIDE 6
How good are they? Can processes “synchronize” using just locks?
Why Locks
Useful coordination mechanism. Can be built with protocols over shared memory. Usually supported by hardware. Available in many programming languages …
SLIDE 7 Synchronizing via Locks
Proc-1 Proc-2
SLIDE 8 Synchronizing via Locks
Proc-1 Proc-2
SLIDE 9 Synchronizing via Locks
Proc-1 Proc-2
SLIDE 10 Synchronizing via Locks
Proc-1 Proc-2
SLIDE 11 Synchronizing via Locks
Proc-1 Proc-2 x
SLIDE 12 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 13 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 14 Synchronizing via Locks
Proc-1 Proc-2 x x
Locks Exchanged.
SLIDE 15 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 16 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 17 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 18 Synchronizing via Locks
Proc-1 Proc-2 x x
SLIDE 19 Synchronizing via Locks
Proc-1 Proc-2 x x x
SLIDE 20 Synchronizing via Locks
Proc-1 Proc-2 x x x x
SLIDE 21 Synchronizing via Locks
Proc-1 Proc-2 x x x x
SLIDE 22 Synchronizing via Locks
Proc-1 Proc-2 x x x x
Locking not well-nested
SLIDE 23 Synchronizing via Locks
Proc-1 Proc-2 x x x x
SLIDE 24 Synchronizing via Locks
Proc-1 Proc-2 x x x x
SLIDE 25 Synchronizing via Locks
Proc-1 Proc-2 x x x x
Chaining of locks. Unboundedly long chains.
SLIDE 26 The control state reachability problem asks if a given global state can be reached from the initial configuration
Reachability:
Reachability problem for a (even two) recursive programs (PDS) with locks is undecidable.
Ramalingam TOPLAS 2000, Kahlon,Ivancic,Gupta CAV05
SLIDE 27 What if we need all locks to be free at the beginning?
Initial Condition on Locks:
A somewhat more elaborate protocol with additional locks works.
Kahlon,Ivancic,Gupta CAV05
SLIDE 28 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a a a b b b
SLIDE 29 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a a a b b b x
SLIDE 30 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a a a b b b x x
SLIDE 31 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a a b b b x x a
SLIDE 32 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a a b b x x a b
SLIDE 33 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b b x x a a b x
SLIDE 34 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x
SLIDE 35 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x x
SLIDE 36 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x x x
SLIDE 37 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x x x x
SLIDE 38 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x x x x x
SLIDE 39 Initializing the Locks:
Kahlon,Ivancic,Gupta CAV05
a b x x a a b b x x x x x x
simulation simulation
SLIDE 40 Decidable Underapproximations:
Nested Locking Locks are taken and released by each process in well-nested (last in first out/stack-like) manner
Kahlon,Ivancic,Gupta CAV05
SLIDE 41 Decidable Underapproximations:
Nested Locking Locks are taken and released by each process in well-nested (last in first out/stack-like) manner
Kahlon,Ivancic,Gupta CAV05
x x
The well-nested assumption is per process (not global).
SLIDE 42 Decidable Underapproximations:
Nested Locking Locks are taken and released by each process in well-nested (last in first out/stack-like) manner
Kahlon,Ivancic,Gupta CAV05
x x
The well-nested assumption is per process (not global). More on nested locking later …
SLIDE 43 Decidable Underapproximations:
Bounded Lock Chains Lock chaining is permitted but there is a priori bound on length of such chains.
Kahlon LICS09
x x
A length 4 lock-chained run
SLIDE 44
Recursive Programs with Locks
SLIDE 45
Recursive Programs with Locks
SLIDE 46
Recursive Programs with Locks
Locks taken in procedure may be released after the procedure terminates
SLIDE 47
Recursive Programs with Locks
Procedures may return locks they did not take
SLIDE 48 Contextual Locking
Contextual Locking Locks taken by a procedure call are returned during the execution
- f that very procedure call.
Chadha,Madhusudan,Vishwanathan TACAS12
Reachability is decidable for 2 processes under contextual locking
Chadha, Madhusudan, Vishwanathan TACAS12 Bonnet, Chadha, Madhusudan, Viswanathan LMCS 2013
SLIDE 49 Sequentializing the runs:
x x x x 1 2 x x x x x x x x x x x x
SLIDE 50 Sequentializing the runs:
x x x x 1 2 L L x x x x x x x x x x x x
SLIDE 51 Sequentializing the runs:
x x x x 1 2 L L
At least L
x x x x x x x x x x x x
SLIDE 52 Sequentializing the runs:
x x x x 1 2 L L
At least L
x x x x x x x x x x x x
SLIDE 53 Sequentializing the runs:
x x x x 1 2 L L
At least L
x x x x x x x x x x x x
SLIDE 54 Sequentializing the runs:
x x x x 1 2 L L
At least L
x x x x x x x x x x x x More locks Available
SLIDE 55 Sequentializing the runs:
x x x x 1 2 L L
At least L
x x x x x x x x x x x x More locks Available More locks Available
SLIDE 56 Contextual Locking: 2 processes
Contextual Locking with 2 processes It suffices to consider runs where the procedure calls of the two processes are also well-nested. Can be simulated by a single PDS. This does not work if there are 3 processes or more.
Chadha,Madhusudan,Vishwanathan TACAS12
SLIDE 57 Contextual Locking: >2 processes
The reachability problem for any number of pushdown systems synchronising via contextual locks is decidable.
Lammich, Muller-Olm, Seidl, Werner SAS13
Stack height bounding argument.
SLIDE 58 m m - |L| (|Q||𝚫|)2
Last time First time
m-i
Stack height bounding:
SLIDE 59 m m-i p q p q m - |L| (|Q||𝚫|)2
Stack height bounding…
SLIDE 60 m m-i p,X q,X m - |L| (|Q||𝚫|)2
Stack height bounding…
SLIDE 61 m m-i p,X q,X p,X q,X m - |L| (|Q||𝚫|)2
Stack height bounding…
SLIDE 62 m m-i p,X q,X p,X q,X m - |L| (|Q||𝚫|)2
Stack height bounding…
Contextual Locking
SLIDE 63 m m-i p,X q,X p,X q,X m - |L| (|Q||𝚫|)2 _.X _.X _.X
Stack height bounding…
Contextual Locking
SLIDE 64 m m-i p,X q,X p,X q,X m - |L| (|Q||𝚫|)2 _.X _.X _.X _.X _.X _.X
Stack height bounding…
Contextual Locking
SLIDE 65 m p,X q,X p,X q,X
Stack height bounding…
m - |L| (|Q||𝚫|)2
SLIDE 66 p q
Stack height bounding…
SLIDE 67 m p,X q,X p,X q,X
Stack height bounding…
m - |L| (|Q||𝚫|)2
SLIDE 68 m p,X q,X p,X q,X
Stack height bounding…
m - |L| (|Q||𝚫|)2
SLIDE 69 m p,X q,X p,X q,X
Stack height bounding…
More locks available for other processes below
m - |L| (|Q||𝚫|)2
SLIDE 70 Contextual Locking: >2 processes
The reachability problem for any number of pushdown systems synchronising via contextual locks is decidable. Exponential (in states, stack alphabet, locks) length paths suffice. In PSPACE.
Lammich, Muller-Olm, Seidl, Werner SAS13
Extension to systems with Dynamic thread creation.
SLIDE 71 Proc one() { < …. > call function(); async-call function(); }
Asynchronous programs:
Sen and Vishwanathan CAV06, Ganty and Majumdar TOPLAS12 …,
SLIDE 72 Proc one() { < …. > call function(); async-call function(); }
Asynchronous programs:
Recursive programs with option to invoke asynchronous calls. The asynchronous calls are stored as tasks that can be retrieved later and executed The stored tasks have no specific
The tasks are executed atomically when there are no other pending calls.
Sen and Vishwanathan CAV06, Ganty and Majumdar TOPLAS12 …,
SLIDE 73 Proc one() { < …. > call function(); async-call function(); }
Asynchronous programs:
Recursive programs with option to invoke asynchronous calls. The asynchronous calls are stored as tasks that can be retrieved later and executed The stored tasks have no specific
The tasks are executed atomically when there are no other pending calls.
Sen and Vishwanathan CAV06, Ganty and Majumdar TOPLAS12 …,
Modeled as a PDS augmented with a multi-set. (MPDS)
SLIDE 74
Decidability:
Control state reachability for pushdown systems equipped with a multi-set is EXPSPACE-Complete
SLIDE 75 Decidability:
Control state reachability for pushdown systems equipped with a multi-set is EXPSPACE-Complete
Sen and Vishwanathan CAV06 Atig, Bouajjani, Touili FSTTCS08 Ganty and Majumdar TOPLAS12
SLIDE 76 Multi-threaded version:
Thread-1 Thread-2 Thread-4 Thread-3
SLIDE 77 Multi-threaded version:
Thread-1 Thread-2 Thread-4 Thread-3
Programs with multiple threads running in parallel
SLIDE 78 Multi-threaded version:
Thread-1 Thread-2 Thread-4 Thread-3
Task Task Task Task
Programs with multiple threads running in parallel Threads can either make a synchronous call or an asynchronous call by delegating it to some thread
SLIDE 79 Multi-threaded version:
Thread-1 Thread-2 Thread-4 Thread-3
Task Task Task Task
Programs with multiple threads running in parallel Threads can either make a synchronous call or an asynchronous call by delegating it to some thread Threads have unbounded unordered buffers to store the tasks
SLIDE 80 Communication:
Locks Thread-1 Thread-2 Thread-4 Thread-3
Task Task Task Task
SLIDE 81 Communication:
Locks
We consider in asynchronous programs synchronising through locks
Thread-1 Thread-2 Thread-4 Thread-3
Task Task Task Task
SLIDE 82 Asynchronous programs + Locks:
Pushdown systems with Multi-sets to hold tasks A finite set of global locks
1 2
Multi set Multi set
SLIDE 83 ∩
⇒
1 2 3 4
Pushdown
Pushdown
Reduce intersection of two pushdown systems
Undecidability under nested locking
4 threads along with two locks and set
l1 l2
= Σ ∪ {l, r}
+
The set of tasks is the alphabet of pushdown systems along with two additional tasks
1 2 3 4
SLIDE 84 Simulation of a move:
1 2
We will show how to simulate a single move of each of the pushdown systems
l1 l1
SLIDE 85 Simulation of a move:
1 2 l1 l1
The Simulation starts with process 3 holding l1
SLIDE 86 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2
Process 1 and 2 test lock l2
SLIDE 87 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2
Process 1 and 2 guess an letter and simulate the move
SLIDE 88 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2 2
Process 1 and 2 sends the guessed letter to 3
SLIDE 89 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2
Process 3 reads and verifies that the letters match
SLIDE 90 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2 1
Process 3 requests 4 to hold lock l2
SLIDE 91 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2 l2 l2
Process 4 reads the request and holds lock l2
SLIDE 92 Simulation of a move:
1 2 l1 l1 l2 l2 l2 l2 l2 l2 1
Process 4 reads the request and holds lock l2
SLIDE 93 Simulation of a move:
1 2 l1 l2 l2 l1 l2 l2 l2 l2
Process process 3 releases l1 on learning l2 is taken
SLIDE 94 Simulation of a move:
1 2 l1 l2 l2 l1 l2 l2 l2 l2 l1 l1 l1 l1
Process 1 and 2 tests lock l1
SLIDE 95 Simulation of a move:
1 2 l1 l2 l2 l1 l2 l2 l2 l2 l1 l1 l1 l1 l1 l1
Process 3 retakes lock l1 and asks 4 to release l2
SLIDE 96 Simulation of a move:
1 2 l1 l2 l1 l2 l2 l2 l2 l1 l1 l1 l1 l1 l2 l1
Process 3 retakes lock l1 and asks 4 to release l2
SLIDE 97
Locks can be held only by task. That is, locks are held only when the stack is not empty
Task locking restriction:
SLIDE 98
Phases of a thread:
SLIDE 99
Phases of a thread:
Task Phases: Complete execution of one task
SLIDE 100
Phases of a thread:
Task Phases: Complete execution of one task Boundary Phase: Initial part of a nonterminating task where all locks are returned
SLIDE 101
Phases of a thread:
Task Phases: Complete execution of one task Boundary Phase: Initial part of a nonterminating task where all locks are returned Lock phases: Part of a nonterminating task that begins with a lock that is never returned, until the next such action.
SLIDE 102
Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
SLIDE 103 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
1
SLIDE 104 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1
SLIDE 105 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3
SLIDE 106 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4
SLIDE 107 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5
SLIDE 108 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5 6
SLIDE 109 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5 6 7
SLIDE 110 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5 6 7 8
SLIDE 111 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5 6 7 8 9
SLIDE 112 Sequentialisation Lemma:
Every reachable configuration can be reached via a run that is a sequence of phases (of the different threads). That is, phases can be executed atomically.
2 1 3 4 5 6 7 8 9
Order in which their first events occur suffices
SLIDE 113
N-threads to 1-thread:
(Guess and) Simulate the phases of all the threads using a single thread.
SLIDE 114
N-threads to 1-thread:
States have to be consistent across phases of a thread. Maintain states
SLIDE 115
N-threads to 1-thread:
Tasks picked for thread i have to be “available” at thread i. States have to be consistent across phases of a thread. Maintain states
SLIDE 116 N-threads to 1-thread:
Tasks picked for thread i have to be “available” at thread i.
- Easy. Use single multiset, but now tasks are tagged with the
associated thread. States have to be consistent across phases of a thread. Maintain states
SLIDE 117 N-threads to 1-thread:
Tasks picked for thread i have to be “available” at thread i. Locks should be handled correctly (taken only when available …)
- Easy. Use single multiset, but now tasks are tagged with the
associated thread. States have to be consistent across phases of a thread. Maintain states
SLIDE 118 N-threads to 1-thread:
Tasks picked for thread i have to be “available” at thread i. Locks should be handled correctly (taken only when available …) Handle multiple pushdown stores
- Easy. Use single multiset, but now tasks are tagged with the
associated thread. States have to be consistent across phases of a thread. Maintain states
SLIDE 119
N-threads to 1-thread: locks
SLIDE 120
N-threads to 1-thread: locks
Lock phases impose restrictions on availability of locks to future phases.
SLIDE 121
N-threads to 1-thread: locks
Lock phases impose restrictions on availability of locks to future phases. Maintain information on availability of locks
SLIDE 122
N-threads to 1-thread: stacks
SLIDE 123
N-threads to 1-thread: stacks
SLIDE 124
N-threads to 1-thread: stacks
Multiple stacks have to be maintained simultaneously.
SLIDE 125 Segments of phases:
i i
A task phase of thread i A lock phase of thread i with lock
i
Boundary phase of thread i
1 2 3 3 1 2 3 1 2 2 3 1 1 3 4 3 3
1 2 3 4 5
Segment 0 — only task phases Segment i+1 — begins with boundary or lock phase, rest are task phases.
SLIDE 126 Segments of phases:
i i
A task phase of thread i A lock phase of thread i with lock
i
Boundary phase of thread i
1 2 3 3 1 2 3 1 2 2 3 1 1 3 4 3 3
1 2 3 4 5
Segment 0 — only task phases Segment i+1 — begins with boundary or lock phase, rest are task phases.
Number of segments is bounded by locks + threads
SLIDE 127 Guiding Sequences:
1 2 3 3 1 2 3 1 2 2 3 1 1 3 4 3 3
1 2 3 4 5
2 2 2 1 2
SLIDE 128 Guiding Sequences:
1 2 3 3 1 2 3 1 2 2 3 1 1 3 4 3 3
1 2 3 4 5
2 2 2 1 2
A sequence identifying the first element of each segment
SLIDE 129 Simulation with a single stack:
2 2 2 1 2
Seg No = 0
SLIDE 130 Simulation with a single stack:
2 2 2 1 2
any task phase
Seg No = 0
SLIDE 131 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
a phase of 2 that takes lock a phase of 2 that takes lock a phase of 2 that takes lock
Seg No = 1
SLIDE 132 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock a phase of 2 that takes lock a phase of 2 that takes lock
Seg No = 1
SLIDE 133 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock a phase of 2 that takes lock
Seg No = 2
SLIDE 134 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock
Seg No = 3
SLIDE 135 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a boundary phase
a phase of 2 that takes lock
Seg No = 4
SLIDE 136 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a boundary phase
task phases, other than thread 2,1 Lock prohibited a phase of 2 that takes lock
Seg No = 4
SLIDE 137 Simulation with a single stack:
2 2 2 1 2
any task phase a boundary phase
task phases, other than thread 2 a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a phase of 2 that takes lock task phases, other than thread 2. Lock prohibited a boundary phase
task phases, other than thread 2,1 Lock prohibited a phase of 2 that takes lock task phases, other than thread 2,1 prohibited
Seg No = 5
SLIDE 138
Complexity:
For a given guiding sequence Exponential blow up due to product of state spaces
SLIDE 139 Complexity:
For a given guiding sequence Exponential blow up due to product of state spaces
Maintain the local states in the multiset
SLIDE 140 Complexity:
For a given guiding sequence Exponential blow up due to product of state spaces
Maintain the local states in the multiset
Reachability via runs consistent with a given guiding sequence reduces to a polynomially larger 1-Thread system.
SLIDE 141
Complexity …
For a given guiding sequence There are only exponentially many guiding sequences
SLIDE 142
Complexity …
For a given guiding sequence
Reachability via runs consistent with a given guiding sequence is in EXPSPACE.
There are only exponentially many guiding sequences
Theorem: Reachability for Asynchronous programs with locks under well-nested, task locking is EXPSPACE-Complete
SLIDE 143
Complexity: underapproximation
What if we also want to verify that the system uses nested locking? Exponential blow up due to set of locks to be maintained. Locks are accessed when the stack is not empty, so can’t be simply moved to the multi-set. Using Parikh’s theorem transform this into FA with multi-sets with 2-EXP number of states, but same multi-set alphabet as in the input. Treat as a VASS with 2-EXP number of states and polynomial number of places. Yen-Rosier show that coverability for VASS can be solved space logarithmic in the number of states and exponential in the number of places.
SLIDE 144
Stateless task scheduling:
Each thread may schedule a new task only from a fixed local state.
Tasks cannot “communicate” via local state of threads A thread just schedules and runs tasks.
SLIDE 145
Stateless task scheduling:
Theorem: Reachability for Asynchronous programs with locks under state-less scheduling, well-nested locks and task locking is NP-Complete
SLIDE 146
Stateless task scheduling:
Theorem: Reachability for Asynchronous programs with locks under state-less scheduling, well-nested locks and task locking is NP-Complete
A polynomial bound on the number of tasks that need to be scheduled to reach any (reachable) state.
SLIDE 147
Bounding the number of tasks
SLIDE 148
Bounding the number of tasks
SLIDE 149
Bounding the number of tasks
SLIDE 150
Bounding the number of tasks
Number of branching points bounded by threads
SLIDE 151
Bounding Path length
SLIDE 152
Bounding Path length
No Branching
SLIDE 153
Bounding Path length
SLIDE 154
Bounding Path length
Path length bounded by Poly(threads, tasks) Width also bounded by threads.
SLIDE 155
Stateless task scheduling:
SLIDE 156
Stateless task scheduling:
Only a polynomial bound on the number of tasks that need to be scheduled.
SLIDE 157
Stateless task scheduling:
Only a polynomial bound on the number of tasks that need to be scheduled. 1-Thread simulation can work with the same number of tasks.
SLIDE 158 Stateless task scheduling:
Only a polynomial bound on the number of tasks that need to be scheduled. 1-Thread simulation can work with the same number of tasks.
Complexity of emptiness of Asynchronous Programs with at most polynomial number of operations on the multi-set.
SLIDE 159 Stateless task scheduling:
Only a polynomial bound on the number of tasks that need to be scheduled. 1-Thread simulation can work with the same number of tasks.
Complexity of emptiness of Asynchronous Programs with at most polynomial number of operations on the multi-set.
Guess and write down a consistent sequence of Multi-set
- perations (consistent: add >= remove at each point for each
task)
SLIDE 160 Stateless task scheduling:
Only a polynomial bound on the number of tasks that need to be scheduled. 1-Thread simulation can work with the same number of tasks.
Complexity of emptiness of Asynchronous Programs with at most polynomial number of operations on the multi-set.
Guess and write down a consistent sequence of Multi-set
- perations (consistent: add >= remove at each point for each
task) Simulate the Asynchronous program as a pushdown on this input.
SLIDE 161
Stateless task scheduling:
Theorem: Reachability for Asynchronous programs with locks under state-less scheduling, well-nested locks and task locking is NP-Complete
SLIDE 162
Stateless task scheduling:
Theorem: Reachability for Asynchronous programs with locks under state-less scheduling, well-nested locks and task locking is NP-Complete
Lower-bound —- reduction from SAT. Take locks to decide on valuation (taking lock x if x = False) Cycle through clauses and check that at least one literal is true.
SLIDE 163
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable.
SLIDE 164
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete.
SLIDE 165
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete. Stateless scheduling is decidable in NP .
SLIDE 166
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete. Stateless scheduling is decidable in NP .
Possible Extensions
SLIDE 167
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete. Stateless scheduling is decidable in NP .
Possible Extensions
Locks + Shared memory. Reasonable restrictions for decidability?
SLIDE 168
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete. Stateless scheduling is decidable in NP .
Possible Extensions
Locks + Shared memory. Reasonable restrictions for decidability? Other locking subclasses: bounded lock chains, contextual locking
SLIDE 169
Conclusion:
Asynchronous programs with nested locks: reachability is undecidable. Decidable under a further task locking restriction. EXPSPACE- Complete. Stateless scheduling is decidable in NP .
Thank you
Possible Extensions
Locks + Shared memory. Reasonable restrictions for decidability? Other locking subclasses: bounded lock chains, contextual locking