Competitive Freshness Algorithms for Wait free Objects Wait-free - - PowerPoint PPT Presentation

competitive freshness algorithms for wait free objects
SMART_READER_LITE
LIVE PREVIEW

Competitive Freshness Algorithms for Wait free Objects Wait-free - - PowerPoint PPT Presentation

Competitive Freshness Algorithms for Wait free Objects Wait-free Objects Peter Damaschke, Phuong Ha & Philippas Tsigas Presentation at the Euro-Par 2006 29 th Aug. 1 st Sept. 2006, Dresden, Germany. Introduction Wait-free data objects


slide-1
SLIDE 1

Competitive Freshness Algorithms for Wait free Objects Wait-free Objects

Peter Damaschke, Phuong Ha & Philippas Tsigas

Presentation at the Euro-Par 2006

29th Aug. – 1st Sept. 2006, Dresden, Germany.

slide-2
SLIDE 2

Wait-free data objects

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Concurrent data objects

– Consistency!

Conclusions

Consistency!

  • Solutions:
  • Solutions:

– Mutual exclusion?

⇒ risks of lock-convoy deadlock & priority inversion ⇒ risks of lock convoy, deadlock & priority inversion

– Non-blocking synchronization Non blocking synchronization

  • Wait-free:

– every operation is guaranteed to finish in a limited number of steps

EuroPar'06 2

steps. ⇒ Suitable for real-time systems

slide-3
SLIDE 3

Freshness

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Reactive systems need read-operations that both respond

fast and return fresh values

Conclusions

W(0) A W(1) B R(0 or 1) C ( ) w3 sensor3 e3 sensor2 sensor1 w1 w2 e1 e2

3

r e0+d CPU0 s0 e0+D e0 r0

EuroPar'06 3

slide-4
SLIDE 4

Earlier work

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Freshness in databases

Conclusions

  • Freshness in caching systems
  • Freshness for concurrent data objects

Freshness for concurrent data objects

– single-writer-to-single-reader asynch. comm.

EuroPar'06 4

slide-5
SLIDE 5

Contributions

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • The first paper that attacks the freshness for

lti it lti d h d bj t

Conclusions

multi-writer multi-reader shared objects

  • Competitive freshness

– An optimal deterministic algorithm An optimal deterministic algorithm – A nearly-optimal randomized algorithm

EuroPar'06 5

slide-6
SLIDE 6

Road-map

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Introduction

Conclusions

Introduction

  • Modeling the problem

Optimal deterministic algorithm

  • Optimal deterministic algorithm
  • Nearly-optimal randomized algorithm
  • Conclusions

EuroPar'06 6

slide-7
SLIDE 7

Model

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Assumptions:

– An upper bound D on operation execution time

Conclusions

An upper bound D on operation execution time

  • Freshness

e f

d d

| | = |) (| e k f

d d =

Freshness

  • Constraints

d fd M f ed ≤ ≤

− |

|

1

M f M ≤ ≤

and

) (d h fd

  • Constraints

sensor3 w3 e

d f d

d ≤

≤ M f D

d ≤

and

sensor2 sensor1 w1 w2 e1 e2 e3 d: delay, 1 ≤ d ≤ D+1 |e |: # fresh values

EuroPar'06 7

CPU0 s0 e1 e0-1+d e0+D e0 |ed|: # fresh values M: # concurrent writes at e0

slide-8
SLIDE 8

Freshness as an online game

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

freshness (log) lnD

M f D M

d

ln ln ln ln ≤ ≤ − D fd ln ln ≤ ≤

Conclusions

d D f d e

d d

ln ln ln ln ln

1

− ≤ ≤ −

Online game:

X

g

  • player (read operation)

vs.

  • malicious adversary

time (log) time (log) lnD

Freshness

EuroPar'06 8

slide-9
SLIDE 9

A deterministic algorithm

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

D M fd ≥

Algorithm: The read accepts the first

f f

Analysis:

Conclusions

f lnD

D M f c

T

/

1 ≈

f lnD

T

f M c ≈

2

f2 x fT fT - ε f1 x fT p x p2 lnD t lnD t p1 x

EuroPar'06 9

D c c = = ⇒

2 1

slide-10
SLIDE 10

Lower bound

D

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Adversary’s strategy:

– Start with c=ln(D)/2 &

Conclusions

Start with c ln(D)/2 & decrease c at unit speed until the player stops. At this time

f lnD

this time,

  • if c > 0, c jumps to the max.
  • if c ≤ 0, c keeps decreasing

ln D

f2 f1

  • Case 1

f1 - p1 = ln D / 2

2

p1

  • Case 2:

f2 - p2 ≥ ln D / 2

lnD t p2X

EuroPar'06 10

⇒ Comp. ratio = e(f-p) ≥

p2

D

slide-11
SLIDE 11

A randomized algorithm

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Ideas:

P t b bilit th

Conclusions

– Put a probability on the freshness c when it starts to go down.

f lnD

  • Algorithm

h g

g

– When c is decreasing, put on it a probability

c a

D p ln / 2 =

– If the game is over (i.e. h=g), put the rest r on the current c

lnD t1 t

EuroPar'06 11

slide-12
SLIDE 12

A randomized algorithm

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Competitive ratio

Conclusions

D c 2 2 ln 1 ln − + = 2 ln 1 ln + ⎯ ⎯ → ⎯

∞ →

D

D

O ti l d i d ti (l D)/2

D 2 ln 1 − +

  • Optimal randomized comp. ratio (ln D)/2,

asymptotically

(cf. TR-CS-2005:17)

EuroPar'06 12

slide-13
SLIDE 13

Conclusions

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • The first paper that defines the freshness

problem for wait-free data objects

Conclusions

problem for wait-free data objects.

  • Competitive freshness

– An optimal deterministic algorithm – A nearly-optimal randomized algorithm

  • Contributions to the online search problem

– New general models

EuroPar'06 13

New general models

slide-14
SLIDE 14

Thank you for your attention! Thank you for your attention!

slide-15
SLIDE 15

A randomized algorithm

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Comp. ratio

D c 2 2 ln 1 ln − + =

Conclusions

  • Randomized online search →

lf lnD

D 2 ln 1+ Randomized online search → deterministic one-way trading:

– exchanging some fraction of money ≈ stopping the search with

f g

money ≈ stopping the search with that probability

  • Conventions:

c

– distributed money on axis lf – T(x): density of exchanged money ⇒ player’s profit = ∫ (x.T(x))

lnD t

EuroPar'06 15

p y p ( ( ))

slide-16
SLIDE 16

Randomized algorithm

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Ideas:

– Exchange /////// when c starts

Conclusions

Exchange /////// when c starts to go down.

lf lnD

  • comp. ratio

f g

p

c a

  • Optimal comp. ratio O(ln D)

(cf TR-CS-2005:17)

lnD t

EuroPar'06 16

(cf. TR CS 2005:17)

slide-17
SLIDE 17

L t f (fi l l )

Analysis

Introduction Modeling the problem Deterministic algorithm Randomized algorithm Concl sions

  • Let x = f – c (final value)
  • Observations:

– T=2 on [c,f] or c=f – ∑ (gaps with T=0) ≤ r f f

Conclusions

∑ (gaps with T=0) ≤ r

  • Player’s profit

x x T=2

⎟ ⎟ ⎞ ⎜ ⎜ ⎛ + + ≥

∫ ∫

+ − − − 2 / ) ln (

2 2 min .

D r t t x t

dt e re dt e f

worst T=0 x+r r

⎟ ⎠ ⎜ ⎝

∫ ∫

+ , r x x r

f ⎟ ⎠ ⎞ ⎜ ⎝ ⎛ − + > D f 2 2 ln 1

  • Adversary profit: f.ln D

ti

T=2 x r

⎠ ⎝ D D ln

⇒ comp. ratio

  • Optimal comp ratio O(ln D)

2 ln D r +

D D c / 2 2 ln 1 ln − + =

EuroPar'06 17

  • Optimal comp. ratio O(ln D)

(cf. TR-CS-2005:17)