O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Quasi-Linearizability: relaxed consistency for improved concurrency.

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

Confira estes a seguir

1 de 32 Anúncio

Mais Conteúdo rRelacionado

Semelhante a Quasi-Linearizability: relaxed consistency for improved concurrency. (20)

Anúncio

Mais de Guy Korland (15)

Mais recentes (20)

Anúncio

Quasi-Linearizability: relaxed consistency for improved concurrency.

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

×