Title How FIFO is Your Concurrent FIFO Queue? Andreas Haas , - - PowerPoint PPT Presentation

title
SMART_READER_LITE
LIVE PREVIEW

Title How FIFO is Your Concurrent FIFO Queue? Andreas Haas , - - PowerPoint PPT Presentation

Title How FIFO is Your Concurrent FIFO Queue? Andreas Haas , Christoph M. Kirsch, Michael Lippautz, Hannes Payer University of Salzburg RACES Workshop, October 2012 1/17 Strict vs. Relaxed FIFO Queues strict FIFO queue implementations


slide-1
SLIDE 1

1/17

Title

RACES Workshop, October 2012

How FIFO is Your Concurrent FIFO Queue?

Andreas Haas, Christoph M. Kirsch, Michael Lippautz, Hannes Payer

University of Salzburg

slide-2
SLIDE 2

2/17

Strict vs. Relaxed FIFO Queues

strict FIFO queue implementations relaxed FIFO queue implementations

slide-3
SLIDE 3

2/17

Strict vs. Relaxed FIFO Queues

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations relaxed FIFO queue implementations

slide-4
SLIDE 4

2/17

Strict vs. Relaxed FIFO Queues

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations linearizable with respect to relaxed FIFO queue semantics relaxed FIFO queue implementations

slide-5
SLIDE 5

2/17

Strict vs. Relaxed FIFO Queues

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations linearizable with respect to relaxed FIFO queue semantics relaxed FIFO queue implementations bounded

  • ut-of-order treatment
  • f queue elements

possible

slide-6
SLIDE 6

2/17

Strict vs. Relaxed FIFO Queues

500 1000 1500 2000 2500 3000 3500 4000 4500 5000 2 10 20 30 40 50 60 70 80

  • perations/ms (more is better)

number of threads LB MS FC

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations linearizable with respect to relaxed FIFO queue semantics relaxed FIFO queue implementations bounded

  • ut-of-order treatment
  • f queue elements

possible

slide-7
SLIDE 7

2/17

Strict vs. Relaxed FIFO Queues

500 1000 1500 2000 2500 3000 3500 4000 4500 5000 2 10 20 30 40 50 60 70 80

  • perations/ms (more is better)

number of threads LB MS FC US k-FIFO (k=80)

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations linearizable with respect to relaxed FIFO queue semantics relaxed FIFO queue implementations bounded

  • ut-of-order treatment
  • f queue elements

possible

slide-8
SLIDE 8

2/17

Strict vs. Relaxed FIFO Queues

500 1000 1500 2000 2500 3000 3500 4000 4500 5000 2 10 20 30 40 50 60 70 80

  • perations/ms (more is better)

number of threads 2RA Scal (p=80) LB MS FC US k-FIFO (k=80) RR Scal (p=80)

linearizable with respect to strict FIFO queue semantics strict FIFO queue implementations linearizable with respect to relaxed FIFO queue semantics relaxed FIFO queue implementations bounded

  • ut-of-order treatment
  • f queue elements

possible

slide-9
SLIDE 9

3/17

How FIFO are Relaxed FIFO Queues?

Some people say relaxed FIFO queues are not enough FIFO. No applications for relaxed FIFO queues.

slide-10
SLIDE 10

3/17

How FIFO are Relaxed FIFO Queues?

We say relaxed FIFO queue implementations can be even more FIFO than strict FIFO queue implementations. Some people say relaxed FIFO queues are not enough FIFO. No applications for relaxed FIFO queues.

slide-11
SLIDE 11

4/17

Example

time a enq b enq a deq b deq

slide-12
SLIDE 12

4/17

Example

linearization point time a enq b enq a deq b deq

slide-13
SLIDE 13

4/17

Example

linearization point time a enq b enq a deq b deq linearizable

slide-14
SLIDE 14

4/17

Example

linearization point time a enq b enq a deq b deq time a enq b enq a deq b deq linearizable

slide-15
SLIDE 15

4/17

Example

linearization point time a enq b enq a deq b deq time a enq b enq a deq b deq linearizable not linearizable

slide-16
SLIDE 16

4/17

Example

linearization point time a enq b enq a deq b deq time a enq b enq a deq b deq linearizable not linearizable

  • ut-of-order execution
  • f overlapping operations
  • ut-of-order treatment
  • f queue elements
slide-17
SLIDE 17

5/17

Key Idea

Record concurrent histories of various FIFO queue implementations. Analyze these concurrent histories using only the invocation times of operations. 2.) 1.)

slide-18
SLIDE 18

5/17

Key Idea

Record concurrent histories of various FIFO queue implementations. Analyze these concurrent histories using only the invocation times of operations. 2.) 1.)

Ideally operations would take zero time

slide-19
SLIDE 19

5/17

Key Idea

Record concurrent histories of various FIFO queue implementations. Analyze these concurrent histories using only the invocation times of operations. 2.) 1.)

Ideally operations would take zero time Independent of the execution time of operations

slide-20
SLIDE 20

6/17

Element-Fairness

time a enq b enq a deq b deq

slide-21
SLIDE 21

6/17

Element-Fairness

time a enq b enq a deq b deq

zero-time linearization

slide-22
SLIDE 22

6/17

Element-Fairness

time a enq

element

  • vertakes element

a b

b enq a deq b deq

zero-time linearization

slide-23
SLIDE 23

6/17

Element-Fairness

time a enq

element

  • vertakes element

a b

b enq a deq b deq

element-fairness = number of overtakings in the zero-time linearization Definition zero-time linearization

slide-24
SLIDE 24

7/17

Experiments

for 10.000 iterations dequeue element { } enqueue unique element all threads do in parallel

slide-25
SLIDE 25

7/17

Experiments

for 10.000 iterations calculate Pi dequeue element { } enqueue unique element calculate Pi all threads do in parallel

slide-26
SLIDE 26

7/17

Experiments

for 10.000 iterations calculate Pi dequeue element { } enqueue unique element calculate Pi all threads do in parallel No dequeues in the first 200 iterations to avoid empty checks. No enqueues in the last 200 iterations to empty the queue.

slide-27
SLIDE 27

8/17

Element-Fairness per Element

0.1 1 10 100 1000 1000 2000 4000 8000 16000 32000 64000 element-fairness per element (logscale, less is better) computational load (logscale) 80 threads

slide-28
SLIDE 28

8/17

Element-Fairness per Element

0.1 1 10 100 1000 1000 2000 4000 8000 16000 32000 64000 element-fairness per element (logscale, less is better) computational load (logscale) 80 threads LB MS FC

slide-29
SLIDE 29

8/17

Element-Fairness per Element

0.1 1 10 100 1000 1000 2000 4000 8000 16000 32000 64000 element-fairness per element (logscale, less is better) computational load (logscale) 80 threads LB MS FC US k-FIFO (k=80)

slide-30
SLIDE 30

8/17

Element-Fairness per Element

0.1 1 10 100 1000 1000 2000 4000 8000 16000 32000 64000 element-fairness per element (logscale, less is better) computational load (logscale) 80 threads LB MS FC US k-FIFO (k=80) RR Scal (p=80) 2RA Scal (p=80)

slide-31
SLIDE 31

9/17

Operation-Fairness

Measure the out-of order execution of single operations

slide-32
SLIDE 32

9/17

Operation-Fairness

Observation: Linearization points induce a strict order on the queue operations Measure the out-of order execution of single operations

slide-33
SLIDE 33

9/17

Operation-Fairness

time a enq b enq a deq b deq

Observation: Linearization points induce a strict order on the queue operations Measure the out-of order execution of single operations

slide-34
SLIDE 34

9/17

Operation-Fairness

time a enq b enq a deq b deq

Observation: Linearization points induce a strict order on the queue operations Measure the out-of order execution of single operations

slide-35
SLIDE 35

a enq b enq

slide-36
SLIDE 36

a enq b enq

  • peration enq

a b

  • vertakes operation enq
slide-37
SLIDE 37

a enq b enq

  • peration enq

a b

  • vertakes operation enq
  • peration-fairness =

number of overtakings in a concurrent history Definition

slide-38
SLIDE 38

10/17

Operation-Age and Operation-Lateness

age (op) = number of operations op overtakes Definition

slide-39
SLIDE 39

10/17

Operation-Age and Operation-Lateness

age (op) = number of operations op overtakes Definition

a enq b enq

age(enq a ) = 0 age(enq b ) = 1

slide-40
SLIDE 40

10/17

Operation-Age and Operation-Lateness

age (op) = number of operations op overtakes lateness (op) = number of operations which overtake op Definition Definition

a enq b enq

age(enq a ) = 0 age(enq b ) = 1

slide-41
SLIDE 41

10/17

Operation-Age and Operation-Lateness

age (op) = number of operations op overtakes lateness (op) = number of operations which overtake op Definition Definition

a enq b enq

age(enq a ) = 0 age(enq b ) = 1 lateness(enq a ) = 1 lateness(enq b ) = 0

slide-42
SLIDE 42

11/17

Experiments (2)

Only for strict FIFO queue implementations at the moment. Measuring relaxed implementations is future work.

slide-43
SLIDE 43

11/17

Experiments (2)

for 10.000 iterations enqueue unique element { } calculate Pi all threads do in parallel Only for strict FIFO queue implementations at the moment. Measuring relaxed implementations is future work.

slide-44
SLIDE 44

11/17

Experiments (2)

for 10.000 iterations enqueue unique element { } calculate Pi all threads do in parallel Only for strict FIFO queue implementations at the moment. Measuring relaxed implementations is future work. dequeue all elements sequentially

  • ne thread does
slide-45
SLIDE 45

12/17

Maximum Operation-Age

1 10 100 1000 2000 4000 8000 16000 32000 64000 maximum operation-age (logscale, less is better) computational load (logscale) 80 threads LB MS FC

slide-46
SLIDE 46

13/17

Maximum Operation-Lateness

10 100 1000 10000 100000 1000 2000 4000 8000 16000 32000 64000 maximum operation-lateness (logscale, less is better) computational load (logscale) 80 threads LB MS FC

slide-47
SLIDE 47

14/17

Number of Overtaking Operations

20 40 60 80 100 1000 2000 4000 8000 16000 32000 64000 % of enqueue operations with operation-age > 0 (less is better) computational load (logscale) 80 threads LB MS FC

slide-48
SLIDE 48

15/17

Number of Overtaken Operations

20 40 60 80 100 1000 2000 4000 8000 16000 32000 64000 % of enqueue operations with operation-lateness > 0 (less is better) computational load (logscale) 80 threads LB MS FC

slide-49
SLIDE 49

16/17

Conclusion

Future work Measure operation-fairness of relaxed FIFO queue implementations. Use element-fairness to analyze implementation of other data structures, e.g. stacks. We introduced metrics to compare the behavior of various FIFO queue implementations. Relaxed implementation can appear more FIFO than strict implementations.

slide-50
SLIDE 50

17/17

Thank You

Thank You

For more information about the queue implementations see http://scal.cs.uni-salzburg.at/ Additional measurement results can be seen on http://scal.cs.uni-salzburg.at/races12/