Quasi-Linearizability: relaxed consistency for improved concurrency.

  • 1,346 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,346
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
16
Comments
0
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Quasi-Linearizability: relaxed consistency for improved concurrency
    Y. Afek, G. Korland, E. Yanovsky Tel-Aviv University
  • 2. Motivation
    Linearizability Intuitive & clear
    BUT, requires strong synchronization
     limited scalability
  • 3. Motivation SEDA
    • Highly concurrent server application
    • 4. Thread pools
    • 5. A task queue and a set of consumer threads
  • Motivation SEDA cont.
    Typically, task queue is a linearizable queue
     May become a contention point
    Head
    Tail
    Task
    Task
    Task
    Task
    Task
    Task Consumers
    Task Producers
  • 6. Motivation Shared Counter
    • Statistical Counter
    • 7. ID generator
  • Motivation HashTable
    • Web Cache
  • Motivation Cont.
    • What about Stack?
    • 8. What about Tree?
    • 9. What about Priority Queue?
  • The Solution
    • Relaxthe linearizability requirement
    • 10. Back to the SEDA example…
    Strict FIFO order is not a must
    Replace FIFO with Loose-FIFO.
  • 11. Example IEventual consistency
    Given a sufficiently long period of timeover which no updates
    are sent, we can expect
    that during this period,
    all updates will,
    eventually, propagate
    through the system and
    all the replicas will be consistent.
  • 12. Example IIQuiescent consistency
    Operations whose occurrence is
    separated by a quiescent state
    should appear in the order of their occurrence.
    An object is in a quiescent state if currently there is no pending or executing operation on that object.
  • 13. The Solution cont.
    • Relax the linearizability requirement
    • 14. Back to the SEAD example…
    Strict FIFO order is not a must
    • Replace FIFO with Loose-FIFO.
    “Quasi-FIFO”
    • When a task is executed, no more than K tasks that were inserted prior to it, are pending execution.
  • Quasi FIFO Queue
    • Random Dequeue
    Task
    k
    Tail
    Head
    Task
    Task
    Task
    Task
    Task
    Task
    Task
    Algorithm idea:
    • do
    • 15. Pick a node at randomfrom the first Knodes
    • 16. dequeueits element if possible.
    • 17. If already dequeued, and the queue is not empty, repeat.
  • Quasi FIFO Example
    enq(x)
    enq(z)
    T1:
    enq(y)
    T2:
    QUASILINEARIZABLE
    NOTLINEARIZABLE
    deq(z)
    deq(y)
    deq(x)
    T3:
    NotLegal Sequential history
    enq(y)
    enq(x)
    enq(z)
    deq(z)
    deq(y)
    deq(x)
    enq(x)
    enq(z)
    deq(z)
    deq(y)
    deq(x)
    enq(y)
    Legal Sequential history
    Distance 2
  • 18. Quasi Linearizable Definition
    Parallel
    Histories
    Legal
    Sequential
    Histories
  • 19. Quasi Linearizable Definition
    H’
    1
    2
    3
    4
    5
    6
    H
    4
    1
    2
    3
    5
    6
    Distance 3
  • 20. Quasi Linearizable Definition
    Example
  • 21. Quasi Linearizable Definition
  • 22. Quasi Linearizable Definition
  • 23. Quasi Linearizable Definition
  • 24. Quasi Linearizable Definition
    Parallel
    Histories
    Q-Quasi-Sequential
    Legal
    Sequential
    Histories
  • 25. Quasi LinearizableFIFO Queue
    Q(deq op)= 0 (cannot move dequeue operations).
    Q(enq op)= K (move enqueue up to distance K).
    ==
    Q(deq not empty op)= K (move dequeue up to distance K).
    Q(deq empty op) = 0 (except dequeueempty).
    Q(enq op)= 0 (cannot move enqueue operations).
  • 26. Segmented Queue
    • Segmented Quasi-Linearizable queue
    • 27. do
    • 28. Pick a randomelement from corresponding segment
    • 29. If empty-segment (Full-segment) remove it (Add new)
    • 30. repeat
    Each segment size == K.
  • 31.
  • 32.
  • 33. Appendix
  • 34. Counting Network (Thanks to “Art of Multiprocessor Programming, Herlihy & Shavit”)
    1
  • 35. Counting Network
    1
    2
  • 36. Counting Network
    1
    2
    3
  • 37. Counting Network
    1
    2
    3
    4
  • 38. Counting Network
    1
    5
    2
    3
    4
  • 39. Counting Network
  • 40. Bitonic[k] not Linearizable
  • 41. Bitonic[W] is not Linearizable
  • 42. Bitonic[W] is not Linearizable
    2
  • 43. Bitonic[W] is not Linearizable
    0
    2
  • 44. Bitonic[W] is not Linearizable
    0
    Problem is:
    • Red finished before Yellow started
    • 45. Red took 2
    • 46. Yellow took 0
    But it is “Quiescently Consistent”
    2
  • 47. Bitonic[W] Counting Network
    Is it K-Quasi LinearizableCounter?
    Yes, for K≥N*W (N-Num of threads)