Local Linearizability
Ana Sokolova joint work with: Christoph Kirsch Tom Henzinger Andreas Holzer Ali Sezgin Helmut Veith Hannes Payer Michael Lippautz Andreas Haas
Local Linearizability Ana Sokolova joint work with: Andreas Haas - - PowerPoint PPT Presentation
Local Linearizability Ana Sokolova joint work with: Andreas Haas Tom Henzinger Andreas Holzer Christoph Kirsch Michael Lippautz Hannes Payer Ali Sezgin Helmut Veith Rigorous methods for engineering of and reasoning about reactive
Ana Sokolova joint work with: Christoph Kirsch Tom Henzinger Andreas Holzer Ali Sezgin Helmut Veith Hannes Payer Michael Lippautz Andreas Haas
Ana Sokolova CiiT 2018
Ana Sokolova
concurrent
CiiT 2018
Ana Sokolova CiiT 2018
Computer Science
Ana Sokolova CiiT 2018
Computer Science
Theoretical Computer Science
Ana Sokolova CiiT 2018
Computer Science
Theoretical Computer Science Concurrency
Ana Sokolova CiiT 2018
Computer Science
Theoretical Computer Science Concurrency Formal Methods
Ana Sokolova CiiT 2018
Computer Science
Theoretical Computer Science Concurrency Formal Methods Algebra and Coalgebra
Ana Sokolova CiiT 2018
Computer Science
Theoretical Computer Science Concurrency Formal Methods Algebra and Coalgebra
Ana Sokolova
Probabilistic Systems
CiiT 2018
Computer Science
Theoretical Computer Science Concurrency Formal Methods Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems
CiiT 2018
Computer Science
Theoretical Computer Science Real-Time Systems Concurrency Formal Methods Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems
CiiT 2018
Computer Science
Theoretical Computer Science Memory Management Systems Real-Time Systems Concurrency Formal Methods Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems
CiiT 2018
Computer Science
Theoretical Computer Science Memory Management Systems Real-Time Systems Concurrency Formal Methods Data Structures Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems
CiiT 2018
Computer Science
Theoretical Computer Science Memory Management Systems Real-Time Systems Concurrency Formal Methods Data Structures Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems Q U A N T I T I E S
CiiT 2018
Computer Science
Theoretical Computer Science Memory Management Systems Real-Time Systems Concurrency Formal Methods Data Structures Algebra and Coalgebra Security
Ana Sokolova
Probabilistic Systems Q U A N T I T I E S
CiiT 2018
Ana Sokolova joint work with: Christoph Kirsch Tom Henzinger Andreas Holzer Ali Sezgin Helmut Veith Hannes Payer Michael Lippautz Andreas Haas
Ana Sokolova CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova CiiT 2018
structure and power
Ana Sokolova CiiT 2018
Ana Sokolova
e.g. pools, queues, stacks
CiiT 2018
Ana Sokolova
e.g. pools, queues, stacks
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
CiiT 2018
sequential consistency
Ana Sokolova
e.g. pools, queues, stacks
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
CiiT 2018
sequential consistency
Ana Sokolova
e.g. pools, queues, stacks e.g. queue legal sequence enq(1)enq(2)deq(1)deq(2)
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
CiiT 2018
sequential consistency
Ana Sokolova
e.g. pools, queues, stacks e.g. queue legal sequence enq(1)enq(2)deq(1)deq(2)
e.g. the concurrent history above is a linearizable queue concurrent history t1:
enq(2) deq(1) enq(1) deq(2)
t2:
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2: [Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2: [Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
1 2 3 4
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
1 2 3 4
there exists a legal sequence that preserves per-thread precedence (program order)
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
t1:
enq(1) deq(2) deq(1)
t2:
enq(2)
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
1 2 3 4
there exists a legal sequence that preserves per-thread precedence (program order)
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
t1:
enq(1) deq(2) deq(1)
t2:
enq(2)
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
1 2 3 4
there exists a legal sequence that preserves per-thread precedence (program order)
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
t1:
enq(1) deq(2) deq(1)
t2:
enq(2)
Ana Sokolova
Linearizability Sequential Consistency
there exists a legal sequence that preserves precedence
t1:
enq(2) deq(1) enq(1) deq(2)
t2:
1 2 3 4
there exists a legal sequence that preserves per-thread precedence (program order)
1 2 3 4
[Herlihy,Wing ’90] [Lamport’79]
CiiT 2018
Ana Sokolova
throughput # of threads / cores
:-))) :-) :-( :-\
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
provide the potential for better-performing implementations
CiiT 2018
Ana Sokolova CiiT 2018
sequential consistency
Ana Sokolova CiiT 2018
sequential consistency
Ana Sokolova
Quantitative relaxations Henzinger, Kirsch, Payer, Sezgin,S. POPL13
CiiT 2018
sequential consistency
Ana Sokolova
Quantitative relaxations Henzinger, Kirsch, Payer, Sezgin,S. POPL13 not “sequentially correct”
CiiT 2018
sequential consistency
Ana Sokolova
Quantitative relaxations Henzinger, Kirsch, Payer, Sezgin,S. POPL13 Local linearizability in this talk not “sequentially correct”
CiiT 2018
sequential consistency
Ana Sokolova
Quantitative relaxations Henzinger, Kirsch, Payer, Sezgin,S. POPL13 Local linearizability in this talk for queues only (feel free to ask for more) not “sequentially correct”
CiiT 2018
sequential consistency
Ana Sokolova
Quantitative relaxations Henzinger, Kirsch, Payer, Sezgin,S. POPL13 Local linearizability in this talk for queues only (feel free to ask for more) not “sequentially correct” too weak
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Local Linearizability (CONCUR16)
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Already present in some shared-memory consistency conditions (not in our form of choice)
CiiT 2018
Ana Sokolova
Already present in some shared-memory consistency conditions (not in our form of choice) Local sequential consistency… is also possible
CiiT 2018
Ana Sokolova
Already present in some shared-memory consistency conditions (not in our form of choice) Local sequential consistency… is also possible no global witness
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable t1-induced history, linearizable
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable t1-induced history, linearizable
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable t1-induced history, linearizable t2-induced history, linearizable
CiiT 2018
Ana Sokolova
t1:
enq(1) deq(1) enq(2) deq(2)
t2:
(sequential) history not linearizable t1-induced history, linearizable t2-induced history, linearizable locally linearizable
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Queue signature ∑ = {enq(x) | x ∈ V} ∪ {deq(x) | x ∈ V} ∪ {deq(empty)}
CiiT 2018
Ana Sokolova
Queue signature ∑ = {enq(x) | x ∈ V} ∪ {deq(x) | x ∈ V} ∪ {deq(empty)} For a history h with a thread T, we put IT = {enq(x)T ∈ h | x ∈ V} OT = {deq(x)T’ ∈ h | enq(x)T ∈ IT} ∪ {deq(empty)}
CiiT 2018
Ana Sokolova
Queue signature ∑ = {enq(x) | x ∈ V} ∪ {deq(x) | x ∈ V} ∪ {deq(empty)} For a history h with a thread T, we put IT = {enq(x)T ∈ h | x ∈ V} OT = {deq(x)T’ ∈ h | enq(x)T ∈ IT} ∪ {deq(empty)}
in-methods of thread T are enqueues performed by thread T
CiiT 2018
Ana Sokolova
Queue signature ∑ = {enq(x) | x ∈ V} ∪ {deq(x) | x ∈ V} ∪ {deq(empty)} For a history h with a thread T, we put IT = {enq(x)T ∈ h | x ∈ V} OT = {deq(x)T’ ∈ h | enq(x)T ∈ IT} ∪ {deq(empty)}
in-methods of thread T are enqueues performed by thread T
are dequeues (performed by any thread) corresponding to enqueues that are in-methods
CiiT 2018
Ana Sokolova
Queue signature ∑ = {enq(x) | x ∈ V} ∪ {deq(x) | x ∈ V} ∪ {deq(empty)} For a history h with a thread T, we put IT = {enq(x)T ∈ h | x ∈ V} OT = {deq(x)T’ ∈ h | enq(x)T ∈ IT} ∪ {deq(empty)}
in-methods of thread T are enqueues performed by thread T
are dequeues (performed by any thread) corresponding to enqueues that are in-methods
h is locally linearizable iff every thread-induced history hT= h | (IT ∪ OT) is linearizable.
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Signature ∑
CiiT 2018
Ana Sokolova
Signature ∑ For a history h with n threads, choose Inh(i) Outh(i)
CiiT 2018
Ana Sokolova
Signature ∑ For a history h with n threads, choose Inh(i) Outh(i)
in-methods of thread i, methods that go in hi
CiiT 2018
Ana Sokolova
Signature ∑ For a history h with n threads, choose Inh(i) Outh(i)
in-methods of thread i, methods that go in hi
dependent methods
(performed by any thread)
CiiT 2018
Ana Sokolova
Signature ∑ For a history h with n threads, choose Inh(i) Outh(i)
in-methods of thread i, methods that go in hi
dependent methods
(performed by any thread)
h is locally linearizable iff every thread-induced history hi = h | (Inh(i) ∪ Outh(i)) is linearizable.
CiiT 2018
Ana Sokolova
Signature ∑ For a history h with n threads, choose Inh(i) Outh(i)
in-methods of thread i, methods that go in hi
dependent methods
(performed by any thread)
h is locally linearizable iff every thread-induced history hi = h | (Inh(i) ∪ Outh(i)) is linearizable.
by increasing the in-methods, LL gradually moves to linearizability
CiiT 2018
Ana Sokolova
In general
Linearizability Sequential Consistency Local Linearizability
CiiT 2018
Ana Sokolova
For queues (and most container-type data structures)
Linearizability Sequential Consistency Local Linearizability
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Local linearizability is compositional
CiiT 2018
Ana Sokolova
Local linearizability is compositional like linearizability unlike sequential consistency
CiiT 2018
Ana Sokolova
Local linearizability is compositional
h (over multiple objects) is locally linearizable iff each per-object subhistory of h is locally linearizable
like linearizability unlike sequential consistency
CiiT 2018
Ana Sokolova
Local linearizability is compositional
h (over multiple objects) is locally linearizable iff each per-object subhistory of h is locally linearizable
like linearizability unlike sequential consistency Local linearizability is modular / “decompositional”
CiiT 2018
Ana Sokolova
Local linearizability is compositional
h (over multiple objects) is locally linearizable iff each per-object subhistory of h is locally linearizable
like linearizability unlike sequential consistency Local linearizability is modular / “decompositional” uses decomposition into smaller histories, by definition
CiiT 2018
Ana Sokolova
Local linearizability is compositional
h (over multiple objects) is locally linearizable iff each per-object subhistory of h is locally linearizable
like linearizability unlike sequential consistency Local linearizability is modular / “decompositional” uses decomposition into smaller histories, by definition may allow for modular verification
CiiT 2018
Ana Sokolova
Queue sequential specification (axiomatic)
s is a legal queue sequence iff
CiiT 2018
Ana Sokolova
Queue sequential specification (axiomatic)
s is a legal queue sequence iff
Queue linearizability (axiomatic)
h is queue linearizable iff
Henzinger, Sezgin, Vafeiadis CONCUR13
CiiT 2018
Ana Sokolova
Queue sequential specification (axiomatic)
s is a legal queue sequence iff
Queue linearizability (axiomatic)
h is queue linearizable iff
Henzinger, Sezgin, Vafeiadis CONCUR13 precedence order
CiiT 2018
Ana Sokolova
Queue sequential specification (axiomatic)
s is a legal queue sequence iff
Queue local linearizability (axiomatic)
h is queue locally linearizable iff
CiiT 2018
Ana Sokolova
Queue sequential specification (axiomatic)
s is a legal queue sequence iff
Queue local linearizability (axiomatic)
h is queue locally linearizable iff
thread-local precedence order
CiiT 2018
Ana Sokolova CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by:
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by:
t2 t1 tn …
Φ Φ Φ
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by: segment of possibly dynamic size (n)
t2 t1 tn …
Φ Φ Φ
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by: segment of possibly dynamic size (n)
t2 t1 tn …
Φ Φ Φ
local inserts / global (randomly distributed) removes
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by: segment of possibly dynamic size (n)
t2 t1 tn …
Φ Φ Φ
local inserts / global (randomly distributed) removes LLD Φ (locally linearizable)
CiiT 2018
Ana Sokolova
Your favorite linearizable data structure implementation
Φ
turns into a locally linearizable implementation by: segment of possibly dynamic size (n)
t2 t1 tn …
Φ Φ Φ
local inserts / global (randomly distributed) removes LLD Φ (locally linearizable) LL+D Φ (also pool linearizable)
CiiT 2018
Ana Sokolova
2 4 6 8 10 12 14 16 18 20 22 24 26 2 10 20 30 40 50 60 70 80 million operations per sec (more is better) number of threads MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ
(a) Queues, LL queues, and “queue-like” pools
CiiT 2018
Ana Sokolova
2 4 6 8 10 12 14 16 18 20 22 24 26 2 10 20 30 40 50 60 70 80 million operations per sec (more is better) number of threads MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ
(a) Queues, LL queues, and “queue-like” pools
LL+D MS queue performs significantly better than MS queue
CiiT 2018
Ana Sokolova
2 4 6 8 10 12 14 16 18 20 22 24 26 2 10 20 30 40 50 60 70 80 million operations per sec (more is better) number of threads MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ
(a) Queues, LL queues, and “queue-like” pools
LLD Φ performs significantly better than Φ
CiiT 2018
Ana Sokolova
2 4 6 8 10 12 14 16 18 20 22 24 26 2 10 20 30 40 50 60 70 80 million operations per sec (more is better) number of threads MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ
(a) Queues, LL queues, and “queue-like” pools
LL+D MS queue performs better than the best known pools
CiiT 2018
Ana Sokolova joint work with: Christoph Kirsch Tom Henzinger Andreas Holzer Ali Sezgin Helmut Veith Hannes Payer Michael Lippautz Andreas Haas
Thank You!
Ana Sokolova joint work with: Christoph Kirsch Tom Henzinger Andreas Holzer Ali Sezgin Helmut Veith Hannes Payer Michael Lippautz Andreas Haas
Thank You!
Andreas Haas Andreas Holzer Michael Lippautz Ali Sezgin Christoph Kirsch Hannes Payer Helmut Veith Tom Henzinger