Presentation is loading. Please wait.

Presentation is loading. Please wait.

DECS: A Dynamic Elimination-Combining Stack Algorithm Gal Bar-Nissan, Danny Hendler, Adi Suissa 1 OPODIS 2011.

Similar presentations


Presentation on theme: "DECS: A Dynamic Elimination-Combining Stack Algorithm Gal Bar-Nissan, Danny Hendler, Adi Suissa 1 OPODIS 2011."— Presentation transcript:

1 DECS: A Dynamic Elimination-Combining Stack Algorithm Gal Bar-Nissan, Danny Hendler, Adi Suissa 1 OPODIS 2011

2 Stack data-structure We focus on the stack data-structure which supports two operations: ◦ push(v) – adds a new element (with value v) to the top of the stack ◦ pop – removes the top element from the stack and returns it 2

3 Previous work – IBM/Treiber algorithm [1986] Linked-list based Shared top pointer next top next new old top 3 new top push operation pop operation  Non-blocking algorithm  Poor scalability (essentially sequential)

4 Previous work – Flat-combining [Hendler, Incze, Shavit, Tzafrir, 2010] A list of operations to be performed Each thread adds its operation to the list One of the threads acquires a global lock and performs the combined operation Other threads spin and wait for their operation to be performed 4 push pop push pop push  Minimizes synchronization  Blocking algorithm  Limited scalability (essentially sequential)

5 Previous work – Elimination Backoff (HSY) [Hendler, Shavit, Yerushalmi, 2004] Eliminating reverse semantics operations A thread attempts its operation: 1.On the central stack (IBM/Treiber algorithm) 2.Elimination Backoff – Eliminate with another thread 5 T1T1 T2T2 T3T3 pop push( ) pop    T1T1 Central Stack  Non-blocking algorithm  Provides parallelism – if workloads are symmetric

6 Our contributions DECS – A Dynamic Elimination-Combining Stack algorithm Dynamically employs either of two techniques: 1.Elimination 2.Combining A non-blocking version (NB-DECS) 6

7 DECS – Dynamic Elimination- Combining Stack Employs IMB/Treiber’s algorithm as a central stack A thread attempts its operation: 1.On the central stack 2.Elimination-Combining Backoff – Eliminate or Combine with another thread 7

8 Elimination-Combining layer 8 A thread attempts its operation on the central stack 1 T1T1 Central Stack op 1 If that fails, it registers itself in a publication array 2 T1T1 It then chooses a random index from the publication array, and looks for another thread 3 If no other thread is found, the thread waits

9 Elimination-Combining layer (cont'd) 9 4 T2T2 Central Stack op 2 T1T1 T2T2 If it finds another thread with a reverse semantics operation, the operations are eliminated 5 op 1 != op 2   Another thread that fails operating on the central stack also registers in the array and tries to find Another thread

10 10 If both threads have identical operation semantics, one thread delegates its operation to the other thread 6 T2T2 Central Stack op 2 T1T1 T2T2 op 1 == op 2 T1T1 Elimination-Combining layer (cont'd) delegate thread

11 Multi-Push 11 T1T1 Central Stack push T1T1 TaTa TaTa TbTb TbTb  

12 Multi-Pop 12 T1T1 Central Stack pop T1T1 TaTa TaTa TbTb TbTb TcTc TcTc    M M = min{stack_size, multi_op_size}

13 Multi-Eliminate 13 T1T1 push T1T1 TaTa TaTa TbTb TbTb T2T2 TcTc TcTc TdTd TdTd TeTe TeTe T2T2 pop     Retry!

14 Data-structures 14

15 Push & Pop operations

16 MultiPop function

17 Collide function 17

18 ActiveCollide, Combine functions 18

19 MultiEliminate function 19

20 PassiveCollide 20

21 Experimental Evaluation Evaluated on an UltraSPARC T2+ – 8 cores CPU (each with 8 hardware threads)  64 hardware threads Compared DECS with: ◦ Treiber (with exponential backoff) ◦ HSY (elimination backoff) algorithm ◦ Flat-Combining (FC) stack 21

22 Symmetric workload 50% push – 50% pop 22 Threads

23 Moderately Asymmetric 75% push – 25% pop 23 Threads

24 Fully Asymmetric 100% push – 0% pop 24 Threads

25 DECS summary  Scalable  Provides parallelism even for asymmetric workloads  Blocking 25

26 Non-blocking DECS A non-blocking algorithm is more robust to thread failures Similar to DECS, but threads that delegate an operation do not wait indefinitely A thread stops waiting by signaling its delegate thread 26

27 NB-DECS - example 27 A thread may stop waiting after some timeout T1T1 Central Stack push T1T1 TaTa TaTa TbTb TbTb X X

28 NB-DECS - overhead 1. Test-and-set validation of each popped element from the central stack 2. Elements must be popped from the central stack one-by-one 3. Test-and-set validation on eliminated operations 28

29 Symmetric workload 50% push – 50% pop 29 Threads

30 Moderately Asymmetric 75% push – 25% pop 30 Threads

31 Moderately Asymmetric 25% push – 75% pop 31 Threads


Download ppt "DECS: A Dynamic Elimination-Combining Stack Algorithm Gal Bar-Nissan, Danny Hendler, Adi Suissa 1 OPODIS 2011."

Similar presentations


Ads by Google