Between Linearizability and Quiescent Consistency Radha Jagadeesan - - PowerPoint PPT Presentation

between linearizability and quiescent consistency
SMART_READER_LITE
LIVE PREVIEW

Between Linearizability and Quiescent Consistency Radha Jagadeesan - - PowerPoint PPT Presentation

Between Linearizability and Quiescent Consistency Radha Jagadeesan James Riely DePaul University Chicago, USA ICALP 2014 Between Linearizability and Quiescent Consistency ICALP 2014 1 Linearizability (Herlihy/Wing 1990) Each method call


slide-1
SLIDE 1

Between Linearizability and Quiescent Consistency

Radha Jagadeesan James Riely

DePaul University Chicago, USA

ICALP 2014

Between Linearizability and Quiescent Consistency ICALP 2014 1

slide-2
SLIDE 2

Linearizability (Herlihy/Wing 1990)

“Each method call should appear to take effect instantaneously at some moment between its invocation and response.” (Herlihy/Shavit 2008) Ie, for every invocation, exists a linearization point such that

linearization point is between call and return real-time order corresponds to some sequential execution Specification Implementation

Compositional (Herlihy/Wing 1990)

Composition of the histories of two non-interfering linearizable objects is linearizable

Intrinsically inefficient (Dwork/Herlihy/Waarts 1997)

Trade-off between high contention and using many variables Data Structures in the Multicore Age (Shavit 2011, CACM)

Between Linearizability and Quiescent Consistency ICALP 2014 2

slide-3
SLIDE 3

Linearizability (Herlihy/Wing 1990)

“Each method call should appear to take effect instantaneously at some moment between its invocation and response.” (Herlihy/Shavit 2008) Ie, for every invocation, exists a linearization point such that

linearization point is between call and return real-time order corresponds to some sequential execution Specification Implementation

Compositional (Herlihy/Wing 1990)

Composition of the histories of two non-interfering linearizable objects is linearizable

Intrinsically inefficient (Dwork/Herlihy/Waarts 1997)

Trade-off between high contention and using many variables Data Structures in the Multicore Age (Shavit 2011, CACM)

Between Linearizability and Quiescent Consistency ICALP 2014 2

slide-4
SLIDE 4

Linearizability (Herlihy/Wing 1990)

“Each method call should appear to take effect instantaneously at some moment between its invocation and response.” (Herlihy/Shavit 2008) Ie, for every invocation, exists a linearization point such that

linearization point is between call and return real-time order corresponds to some sequential execution Specification Implementation

Compositional (Herlihy/Wing 1990)

Composition of the histories of two non-interfering linearizable objects is linearizable

Intrinsically inefficient (Dwork/Herlihy/Waarts 1997)

Trade-off between high contention and using many variables Data Structures in the Multicore Age (Shavit 2011, CACM)

Between Linearizability and Quiescent Consistency ICALP 2014 2

slide-5
SLIDE 5

Linearizability (Herlihy/Wing 1990)

“Each method call should appear to take effect instantaneously at some moment between its invocation and response.” (Herlihy/Shavit 2008) Ie, for every invocation, exists a linearization point such that

linearization point is between call and return real-time order corresponds to some sequential execution Specification Implementation

Compositional (Herlihy/Wing 1990)

Composition of the histories of two non-interfering linearizable objects is linearizable

Intrinsically inefficient (Dwork/Herlihy/Waarts 1997)

Trade-off between high contention and using many variables Data Structures in the Multicore Age (Shavit 2011, CACM)

Between Linearizability and Quiescent Consistency ICALP 2014 2

slide-6
SLIDE 6

Linearizability (Herlihy/Wing 1990)

“Each method call should appear to take effect instantaneously at some moment between its invocation and response.” (Herlihy/Shavit 2008) Ie, for every invocation, exists a linearization point such that

linearization point is between call and return real-time order corresponds to some sequential execution Specification Implementation

Compositional (Herlihy/Wing 1990)

Composition of the histories of two non-interfering linearizable objects is linearizable

Intrinsically inefficient (Dwork/Herlihy/Waarts 1997)

Trade-off between high contention and using many variables Data Structures in the Multicore Age (Shavit 2011, CACM)

Between Linearizability and Quiescent Consistency ICALP 2014 2

slide-7
SLIDE 7

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-8
SLIDE 8

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-9
SLIDE 9

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-10
SLIDE 10

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-11
SLIDE 11

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-12
SLIDE 12

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-13
SLIDE 13

Quiescent Consistency (Aspnes/Herlihy/Shavit 1991)

Weaker than Linearizability (Lin ⇒ QC) Compositional “Method calls separated by a period of quiescence should appear to take effect in their real-time order.” (Herlihy/Shavit 2008) Spec Impl

is a quiescent point Aspnes/Herlihy/Shavit (1991) actually prove other things

Step property (weaker than QC) Concretely: When quiescent, state is “very sensible” Abstractly: If at any point accessed sequentially, behaves sequentially Gap property (morally “stronger” than QC) Concretely: Even when not quiescent, state is “pretty sensible” Abstractly: ??? This paper

Between Linearizability and Quiescent Consistency ICALP 2014 3

slide-14
SLIDE 14

But first. . . Weak Quiescent Consistency

Abstract view of “step property” If at any point accessed sequentially, behaves sequentially Spec Exec

No comment about periods of concurrency

QC requires permutation Weak QC does not (may be no spec trace with same set of events)

Between Linearizability and Quiescent Consistency ICALP 2014 4

slide-15
SLIDE 15

But first. . . Weak Quiescent Consistency

Abstract view of “step property” If at any point accessed sequentially, behaves sequentially Spec Exec

No comment about periods of concurrency

QC requires permutation Weak QC does not (may be no spec trace with same set of events)

Between Linearizability and Quiescent Consistency ICALP 2014 4

slide-16
SLIDE 16

But first. . . Weak Quiescent Consistency

Abstract view of “step property” If at any point accessed sequentially, behaves sequentially Spec Exec Exec

No comment about periods of concurrency

QC requires permutation Weak QC does not (may be no spec trace with same set of events)

Between Linearizability and Quiescent Consistency ICALP 2014 4

slide-17
SLIDE 17

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Between Linearizability and Quiescent Consistency ICALP 2014 5

slide-18
SLIDE 18

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Between Linearizability and Quiescent Consistency ICALP 2014 5

slide-19
SLIDE 19

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Between Linearizability and Quiescent Consistency ICALP 2014 5

slide-20
SLIDE 20

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Between Linearizability and Quiescent Consistency ICALP 2014 5

Called early

slide-21
SLIDE 21

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Between Linearizability and Quiescent Consistency ICALP 2014 5

Called early Returns late

slide-22
SLIDE 22

This paper... Quantitative Quiescent Consistency

Between Linearizability and QC (Lin ⇒ QQC ⇒ QC) Compositional “Nonlinearizable behavior proportional to number of early concurrent calls” Spec Impl

Early concurrent calls enable out-of-order behavior

Between Linearizability and Quiescent Consistency ICALP 2014 5

Called early Returns late

slide-23
SLIDE 23

Definitions

Number the call/return pairs of the specification

[ [ [1 ] ] ]1 ( ( (2 ) ) )2 { { {3 } } }3

  • 4
  • 4
  • 5
  • 5
  • 6
  • 6 ···

··· Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Herlihy/Wing 1990) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) )j

(Theorem 2.2) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-24
SLIDE 24

Definitions

Number the call/return pairs of the specification Spec

✓ ✗ ✗ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Herlihy/Wing 1990) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) ) j

(Theorem 2.2) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-25
SLIDE 25

Definitions

Number the call/return pairs of the specification Spec

✓ ✓ ✓ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Herlihy/Wing 1990) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) ) j

(Theorem 2.2) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-26
SLIDE 26

Definitions

Number the call/return pairs of the specification Spec

✓ ✗ ✗ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Return-to-call) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) )j

(Call-to-return) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-27
SLIDE 27

Definitions

Number the call/return pairs of the specification Spec

✓ ✗ ✗ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Herlihy/Wing 1990) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) )j

(Theorem 2.2) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-28
SLIDE 28

Definitions

Number the call/return pairs of the specification Spec

✓ ✓ ✗ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Herlihy/Wing 1990) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Definition 3.1) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) )j

(Theorem 2.2) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Calculation) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Theorem 4.3)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-29
SLIDE 29

Definitions

Number the call/return pairs of the specification Spec

✓ ✓ ✗ ✗

Linearizability: If )

) )i

precedes

− − − − − → [

[ [ j then i < j

(Return-to-call) QC: If }

} }i

quiescent

− − − − − → (

( (j then i < j

(Return-to-call) Linearizability: If i < j then [

[ [i

precedes

− − − − − → )

) ) j

(Call-to-return) Linearizability: {i | [

[ [i

precedes

− − − − − → )

) )j} ⊇ {1, ..., j}

(Call-to-return) QQC:

  • {i | [

[ [i

precedes

− − − − − → }

} } j}

  • {1, ..., j}
  • = j

(Call-to-return)

Between Linearizability and Quiescent Consistency ICALP 2014 6

slide-30
SLIDE 30

Interesting examples

Enabling early call can be used repeatedly Enablers can accumulate Enablers can themselves be out-of-order

Between Linearizability and Quiescent Consistency ICALP 2014 7

slide-31
SLIDE 31

Interesting examples

Enabling early call can be used repeatedly Enablers can accumulate Enablers can themselves be out-of-order

Between Linearizability and Quiescent Consistency ICALP 2014 7

slide-32
SLIDE 32

Interesting examples

Enabling early call can be used repeatedly Enablers can accumulate Enablers can themselves be out-of-order

Between Linearizability and Quiescent Consistency ICALP 2014 7

slide-33
SLIDE 33

Quiescently Consistent Data Structures

Counting networks

Bitonic Networks (Aspnes/Herlihy/Shavit 1991) Diffracting Trees (Shavit/Zemach 1994) Decrement/increment(Shavit/Touitou 1995) (Aiello/Busch/Herlihy/Mavronicolas/Shavit/Toutoui 1999)

Stacks and Bags (aka, Pools)

Elimination Arrays/Trees (Shavit/Touitou 1995)

“Almost” Linearizable

Experimental results Theory involving max/min times (Lynch/Shavit/Shvartsman/Touitou 1996)

The Art of Multiprocessor Programming (Herlihy/Shavit 2008)

Between Linearizability and Quiescent Consistency ICALP 2014 8

slide-34
SLIDE 34

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=0 c[0]=0 c[1]=1

slide-35
SLIDE 35

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=1 c[0]=0 [inc c[1]=1

slide-36
SLIDE 36

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=1 c[0]=2 [inc ]

inc

c[1]=1

slide-37
SLIDE 37

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=0 c[0]=2 [inc ]

inc

c[1]=1 (inc

slide-38
SLIDE 38

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=0 c[0]=2 [inc ]

inc

c[1]=3 (inc )

inc 1

slide-39
SLIDE 39

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=1 c[0]=2 [inc ]

inc

{inc c[1]=3 (inc )

inc 1

slide-40
SLIDE 40

N-counter (simplified from Aspnes/Herlihy/Shavit 1991)

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

[inc

− − − → b = 1, c = [0, 1]

]inc

− − − → b = 1, c = [2, 1]

(inc

− − − → b = 0, c = [2, 1]

)inc

1

− − − → b = 0, c = [2, 3]

{inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Behaves sequentially

Between Linearizability and Quiescent Consistency ICALP 2014 9

b=1 c[0]=4 [inc ]

inc

{inc }

inc 2

c[1]=3 (inc )

inc 1

slide-41
SLIDE 41

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=0 c[0]=0 c[1]=1

slide-42
SLIDE 42

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=1 c[0]=0 {inc c[1]=1

slide-43
SLIDE 43

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=0 c[0]=0 {inc c[1]=1 (inc

slide-44
SLIDE 44

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=0 c[0]=0 {inc c[1]=3 (inc )

inc 1

slide-45
SLIDE 45

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=1 c[0]=0 {inc [inc c[1]=3 (inc )

inc 1

slide-46
SLIDE 46

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=1 c[0]=2 {inc [inc ]

inc

c[1]=3 (inc )

inc 1

slide-47
SLIDE 47

N-counter — Execution 2

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } }

b = 0, c = [0, 1]

{inc

− − − → b = 1, c = [0, 1]

(inc

− − − → b = 0, c = [0, 1]

)inc

1

− − − → b = 0, c = [0, 3]

[inc

− − − → b = 1, c = [0, 3]

]inc

− − − → b = 1, c = [2, 3]

}inc

2

− − − → b = 1, c = [4, 3] Not Linearizable , but QQC

Between Linearizability and Quiescent Consistency ICALP 2014 10

b=1 c[0]=4 {inc [inc ]

inc

}

inc 2

c[1]=3 (inc )

inc 1

slide-48
SLIDE 48

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0 c[1]=1

slide-49
SLIDE 49

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=1 c[0]=0

[ [ [inc

c[1]=1

slide-50
SLIDE 50

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0

[ [ [inc

c[1]=1

( ( (inc

slide-51
SLIDE 51

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=1 c[0]=0

[ [ [inc

c[1]=1

( ( (inc { { {dec

slide-52
SLIDE 52

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0

[ [ [inc

  • dec

c[1]=1

( ( (inc { { {dec

slide-53
SLIDE 53

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=-2

[ [ [inc

  • dec
  • dec

−2

c[1]=1

( ( (inc { { {dec

slide-54
SLIDE 54

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0

[ [ [inc

  • dec
  • dec

−2 ]

] ]

inc −2

c[1]=1

( ( (inc { { {dec

slide-55
SLIDE 55

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0

[ [ [inc

  • dec
  • dec

−2 ]

] ]

inc −2

c[1]=3

( ( (inc { { {dec ) ) )

inc 1

slide-56
SLIDE 56

Increment/Decrement counter

class Counter<N:Int> { field b:[0..N-1] = 0; // 1 balancer field c:Int[] = [0, 1, ..., N-1]; // N counters method getAndIncrement():Int { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = c[i]; c[i] += N; return v; } } } method decrementAndGet():Int { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { c[i] -= N; return c[i]; } }

b = 0, c = [0, 1]

[ [ [inc

− − → b = 1, c = [0, 1]

( ( (inc

− − − → b = 0, c = [0, 1]

{ { {dec

− − − → b = 1, c = [0, 1]

  • dec

− − − → b = 0, c = [0, 1]

  • dec

−2

− − → b = 0, c = [−2, 1]

] ] ]inc

−2

− − → b = 0, c = [0, 1]

) ) )inc

1

− − → b = 0, c = [0, 3]

} } }dec

1

− − − → b = 0, c = [0, 1] Only weak QC

dec −2 inc −2 inc 1 dec 1

not a permutation of any spec trace!

Between Linearizability and Quiescent Consistency ICALP 2014 11

b=0 c[0]=0

[ [ [inc

  • dec
  • dec

−2 ]

] ]

inc −2

c[1]=1

( ( (inc { { {dec ) ) )

inc 1

} } }

dec 1

slide-57
SLIDE 57

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]= s[1]=

slide-58
SLIDE 58

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=1 s[0]= [psh

a

s[1]=

slide-59
SLIDE 59

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]= [psh

a

s[1]= (psh

b

slide-60
SLIDE 60

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=1 s[0]= [psh

a

s[1]= (psh

b

{pop

slide-61
SLIDE 61

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]= [psh

a

<pop s[1]= (psh

b

{pop

slide-62
SLIDE 62

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]= [psh

a

<pop >

pop fail

s[1]= (psh

b

{pop

slide-63
SLIDE 63

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]=a [psh

a

<pop >

pop fail ] psh

s[1]= (psh

b

{pop

slide-64
SLIDE 64

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]=a [psh

a

<pop >

pop fail ] psh

s[1]=b (psh

b

{pop )

psh

slide-65
SLIDE 65

Stack

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

(psh

b

− − − → b = 0, s = [[ ], [ ]]

{pop

− − − → b = 1, s = [[ ], [ ]]

<pop

− − − → b = 0, s = [[ ], [ ]]

>pop

fail

− − − → b = 0, s = [[ ], [ ]]

]psh

− − − → b = 0, s = [[a], [ ]]

)psh

− − − → b = 0, s = [[a], [b]]

}pop

b

− − − → b = 0, s = [[a], [ ]] Linearizable

Between Linearizability and Quiescent Consistency ICALP 2014 12

b=0 s[0]=a [psh

a

<pop >

pop fail ] psh

s[1]= (psh

b

{pop )

psh } pop b

slide-66
SLIDE 66

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]= s[1]=

slide-67
SLIDE 67

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=1 s[0]= [psh

a

s[1]=

slide-68
SLIDE 68

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=1 s[0]=a [psh

a

]

psh

s[1]=

slide-69
SLIDE 69

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]=a [psh

a

]

psh

s[1]= {psh

b

slide-70
SLIDE 70

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]=a [psh

a

]

psh

s[1]=b {psh

b

}

psh

slide-71
SLIDE 71

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=1 s[0]=a [psh

a

]

psh

)

psh

s[1]=b {psh

b

}

psh

slide-72
SLIDE 72

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]=a [psh

a

]

psh

)

psh <pop

s[1]=b {psh

b

}

psh

slide-73
SLIDE 73

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]= [psh

a

]

psh

)

psh <pop

>

pop a

s[1]=b {psh

b

}

psh

slide-74
SLIDE 74

Stack — Execution 2

class Stack<N:Int> { field b:[0..N-1] = 0; // 1 balancer field s:Stack[] = [[], [], ..., []]; // N stacks of values method push(x:Object):Unit { val i:[0..N-1]; atomic { i = b; b++; } atomic { val v = s[i].push(x); return v; } } method pop():Object { val i:[0..N-1]; atomic { i = b-1; b--; } atomic { val v = s[i].pop(); return v; } } }

b = 0, s = [[ ], [ ]]

[psh

a

− − − → b = 1, s = [[ ], [ ]]

]psh

− − − → b = 1, s = [[a], [ ]]

{psh

b

− − − → b = 0, s = [[a], [ ]]

}psh

− − − → b = 0, s = [[a], [b]]

(psh

c

− − − → b = 1, s = [[a], [b]]

<pop

− − − → b = 0, s = [[a], [b]]

>pop

a

− − − → b = 0, s = [[_], [b]]

)psh

− − − → b = 0, s = [[c], [b]] Not even quiescent consistent should pop from

  • r

, but not

Between Linearizability and Quiescent Consistency ICALP 2014 13

b=0 s[0]=c [psh

a

]

psh

)

psh <pop

>

pop a

)

psh

s[1]=b {psh

b

}

psh

slide-75
SLIDE 75

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 14

slide-76
SLIDE 76

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 14

slide-77
SLIDE 77

Return-to-call characterization

Linearizability: ∀prefix/suffix = exec ∀ret ∈ prefix ∀call ∈ suffix ret exec − − → call implies ret

spec

− − → call

Between Linearizability and Quiescent Consistency ICALP 2014 15

slide-78
SLIDE 78

Return-to-call characterization

Quiescent consistency: ∀prefix/suffix = exec if prefix has 0 open calls, then ∀ret ∈ prefix ∀call ∈ suffix ret exec − − → call implies ret

spec

− − → call

Between Linearizability and Quiescent Consistency ICALP 2014 15

slide-79
SLIDE 79

Return-to-call characterization

QQC: ∀prefix/suffix = exec if prefix has k open/early calls, then there exists

  • ignoredCalls
  • ≤ k

∀ret ∈ prefix ∀call ∈ suffix−ignoredCalls ret exec − − → call implies ret

spec

− − → call

Between Linearizability and Quiescent Consistency ICALP 2014 15

slide-80
SLIDE 80

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-81
SLIDE 81

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-82
SLIDE 82

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-83
SLIDE 83

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-84
SLIDE 84

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-85
SLIDE 85

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-86
SLIDE 86

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-87
SLIDE 87

Results

Three characterizations of QQC

Call-to-return (given earlier) Return-to-call (à la Herlihy/Wing) Proxy for sequential implementation (flat combiner + speculation)

Single thread accesses sequential structure Upon receiving actual call, speculatively execute any method with any args Only return when speculative call matches actual call

Proof of compositionality

Global constraints that are solvable because of “flow” properties

Proofs and counterexamples for tree-based structures

Increment/decrement N-counter (weak QC) Increment-only N-counter (QQC) General N-stack (QC) “Properly popped” N-stack (QQC)

Pop must wait for concurrent push on same underlying stack Not sufficient for pop to wait on empty stack Proof uses instrumented N-stack that emits a QQC specification trace

Tree of N-stacks (same as single N-stack)

Between Linearizability and Quiescent Consistency ICALP 2014 16

slide-88
SLIDE 88

Related work

Quantitative Relaxation of Concurrent Data Structures (Henzinger/Kirsch/Payer/Sezgin/Sokolova 2013) Incomparable (Examples from Sezgin)

Stack that is 1-out-of-order but not QQC: (psh

c

[psh

a

]psh {psh

b

}psh )psh <pop >pop

a

However, (psh

c

[psh

a

]psh {psh

b

}psh <pop >pop

a

)psh is QQC w.r.t. the stack spec {psh

b

}psh [psh

a

]psh <pop >pop

a

(psh

c

)psh For stacks, it may be that QQC is finer that n-out-of-order (arbitrary n) Queue that is QQC but not (n−1)-out-of-order: (psh

a

[psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh {psh

c

}psh <pop >pop

c

)psh This is QQC w.r.t. {psh

c

}psh [psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh <pop >pop

c

(psh

a

)psh

Between Linearizability and Quiescent Consistency ICALP 2014 17

slide-89
SLIDE 89

Related work

Quantitative Relaxation of Concurrent Data Structures (Henzinger/Kirsch/Payer/Sezgin/Sokolova 2013) Incomparable (Examples from Sezgin)

Stack that is 1-out-of-order but not QQC: (psh

c

[psh

a

]psh {psh

b

}psh )psh <pop >pop

a

However, (psh

c

[psh

a

]psh {psh

b

}psh <pop >pop

a

)psh is QQC w.r.t. the stack spec {psh

b

}psh [psh

a

]psh <pop >pop

a

(psh

c

)psh For stacks, it may be that QQC is finer that n-out-of-order (arbitrary n) Queue that is QQC but not (n−1)-out-of-order: (psh

a

[psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh {psh

c

}psh <pop >pop

c

)psh This is QQC w.r.t. {psh

c

}psh [psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh <pop >pop

c

(psh

a

)psh

Between Linearizability and Quiescent Consistency ICALP 2014 17

slide-90
SLIDE 90

Related work

Quantitative Relaxation of Concurrent Data Structures (Henzinger/Kirsch/Payer/Sezgin/Sokolova 2013) Incomparable (Examples from Sezgin)

Stack that is 1-out-of-order but not QQC: (psh

c

[psh

a

]psh {psh

b

}psh )psh <pop >pop

a

However, (psh

c

[psh

a

]psh {psh

b

}psh <pop >pop

a

)psh is QQC w.r.t. the stack spec {psh

b

}psh [psh

a

]psh <pop >pop

a

(psh

c

)psh For stacks, it may be that QQC is finer that n-out-of-order (arbitrary n) Queue that is QQC but not (n−1)-out-of-order: (psh

a

[psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh {psh

c

}psh <pop >pop

c

)psh This is QQC w.r.t. {psh

c

}psh [psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh <pop >pop

c

(psh

a

)psh

Between Linearizability and Quiescent Consistency ICALP 2014 17

slide-91
SLIDE 91

Related work

Quantitative Relaxation of Concurrent Data Structures (Henzinger/Kirsch/Payer/Sezgin/Sokolova 2013) Incomparable (Examples from Sezgin)

Stack that is 1-out-of-order but not QQC: (psh

c

[psh

a

]psh {psh

b

}psh )psh <pop >pop

a

However, (psh

c

[psh

a

]psh {psh

b

}psh <pop >pop

a

)psh is QQC w.r.t. the stack spec {psh

b

}psh [psh

a

]psh <pop >pop

a

(psh

c

)psh For stacks, it may be that QQC is finer that n-out-of-order (arbitrary n) Queue that is QQC but not (n−1)-out-of-order: (psh

a

[psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh {psh

c

}psh <pop >pop

c

)psh This is QQC w.r.t. {psh

c

}psh [psh

b1

]psh [psh

b1

]psh ···[psh

bn

]psh <pop >pop

c

(psh

a

)psh

Between Linearizability and Quiescent Consistency ICALP 2014 17

slide-92
SLIDE 92

Proxy characterization code

interface Object { method run(i:Invocation):Response; method predict():Invocation; } class QQCProxy<o:Object> { field called:ThreadSafeMultiMap<Invocation,Semaphore> = []; field returned:ThreadSafeMap <Semaphore, Response> = []; method run(i:Invocation):Response { // proxy for external access to o val m:Semaphore = []; called.add(i, m); m.wait(); return returned.remove(m); } thread { // single thread to interact with o val received:MultiMap<Invocation,Semaphore> = []; val executed:MultiMap<Invocation,Response> = []; repeatedly choose { choice if called.notEmpty() { received.add(called.removeAny()); val i:Invocation = o.predict(); val r:Response = o.run(i); executed.add(i, r); } choice if exists i in received.keys() intersect executed.keys() { val m:Semaphore = received.remove(i); val r:Response = executed.remove(i); returned.add(m, r); m.signal(); } } } }

Between Linearizability and Quiescent Consistency ICALP 2014 18