an efficient wait free resizable hash table
play

An Efficient Wait-free Resizable Hash Table Panagiota Fatourou 1,2 , - PowerPoint PPT Presentation

An Efficient Wait-free Resizable Hash Table Panagiota Fatourou 1,2 , Nikolaos Kallimanis 1 , Thomas Ropars 3 1 FORTH ICS 2 University of Crete 3 Univ. Grenoble Alpes 1 2018 A new combination of properties for a hash table Context Dictionary of


  1. An Efficient Wait-free Resizable Hash Table Panagiota Fatourou 1,2 , Nikolaos Kallimanis 1 , Thomas Ropars 3 1 FORTH ICS 2 University of Crete 3 Univ. Grenoble Alpes 1 2018

  2. A new combination of properties for a hash table Context Dictionary of Key-Value pairs Important data structure in several domains (OS, etc.) A resizable hash table Provides the strongest progress guarantee (wait-freedom) Targets the most common load for a hash table ◮ Large majority of Lookup operations Outperforms existing non-blocking algorithms for such workloads ◮ By enforcing 2 important design rules 2 2018

  3. Hash tables 00 000010 A hash function associates items to buckets 01 ◮ Fixed-size buckets 010000 00 011110 01 3 operations: 10 10 ◮ Insert(K, V) (If K 11 already exists, V is updated) ◮ Delete(K) ◮ Lookup(K) 11 3 2018

  4. Dynamic hashing 00 000010 000 010 001 010000 01 01 010011 010 010000 011 011 011110 Adapts the number of buckets 011110 100 to the number of items 101 1 Ensures constant average time 110 for operations 111 Insert(010011) 4 2018

  5. Dynamic hashing 00 000010 000 010 001 010000 01 01 010011 010 010000 011 011 011110 Adapts the number of buckets 011110 100 to the number of items 101 1 Ensures constant average time 110 for operations 111 Insert(010011) 4 2018

  6. Dynamic hashing 00 000010 000 010 001 010000 01 01 010011 010 010000 011 011 011110 Adapts the number of buckets 011110 100 to the number of items 101 1 Ensures constant average time 110 for operations 111 Insert(010011) 4 2018

  7. Extendible hashing 00 00 00 0010 000010 00 0 000 010 00 1 001 010000 Hash keys manipulated as bit 010011 010 010 strings 011 011 011 011110 ◮ A prefix of the key is used to 100 100 101 101 find the appropriate bucket 1 110 110 111 111 Resizing actions are local ◮ Splitting and merging buckets Insert(010011) 5 2018

  8. Extendible hashing 00 00 00 0010 000010 00 0 000 010 00 1 001 010000 Hash keys manipulated as bit 010011 010 010 strings 011 011 011 011110 ◮ A prefix of the key is used to 100 100 101 101 find the appropriate bucket 1 110 110 111 111 Resizing actions are local ◮ Splitting and merging buckets Insert(010011) 5 2018

  9. A wait-free concurrent hash table 00 Natural parallelism 000010 Operations applying to different 000 010 parts of the hash table can run 001 010000 in parallel 010011 010 More complex with dynamic 011 011 011110 hashing 100 101 1 110 111 T A : Insert(100000) T B : Insert(010011) 6 2018

  10. A wait-free concurrent hash table 00 Natural parallelism 000010 Operations applying to different 000 010 parts of the hash table can run 001 010000 in parallel 010011 010 More complex with dynamic 011 011 011110 hashing 100 101 1 110 Non-blocking algorithm 111 Lock freedom: At least one thread makes progress T A : Insert(100000) Wait freedom : Every T B : Insert(010011) operation completes in a finite number of steps 6 2018

  11. Towards an efficient resizable hash table: Insights Most common load for a hash table Large majority of Lookup() operations Resizing actions are rare Design rules to achieve best performance Lookup() operations should always be allowed to proceed without any synchronization When no resizing actions are executed, update operations applying to different buckets should be allowed to progress fully in parallel 7 2018

  12. Related work The split-ordered list (LF-Split) Shalev and Shavit [PODC’03] LF-Split does not comply with our design rules ◮ During Lookup() operations, threads have to help removing items marked for deletion. ◮ A global counter is modified after every insertion/deletion. LF/WF-Freeze Liu, Zhang, and Spear [PODC’14] WF-Freeze does not comply with our design rules ◮ A global sequence number is required to tag update operations 8 2018

  13. Contributions The design of a wait-free extendible hash table Follows our two design rules First algorithm to use several instances of the PSim universal construction [SPAA’11]. ◮ Appropriatly synchronized to ensure wait-freedom Experiments demonstrate the new performance trade-off Outperforms all existing non-blocking resizable hash tables when resizing actions are rare Slower resizing 9 2018

  14. Our Wait-Free Algorithm

  15. The PSim algorithm Fatourou and Kallimanis [SPAA’11] T 2 : Insert(001110) BState BState 00 00 00 b 000010 001110 000010 help: op 0 op 0 op 2 a: 0 0 0 0 a: 0 1 0 0 0 1 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  16. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed T 2 : Insert(001110) BState BState 00 00 00 b 000010 001110 000010 help: op 0 op 0 op 2 a: 0 0 0 0 a: 0 1 0 0 0 1 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  17. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed Make a local copy of the object to update T 2 : Insert(001110) BState BState 00 00 00 b 000010 001110 000010 help: op 0 op 0 op 2 a: 0 0 0 0 a: 0 1 0 0 0 1 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  18. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed Make a local copy of the object to update Apply all pending operations on the local object T 2 : Insert(001110) BState BState 00 00 00 b 000010 001110 000010 help: op 0 op 0 op 2 a: 0 0 0 0 a: 0 1 0 0 0 1 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  19. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed Make a local copy of the object to update Apply all pending operations on the local object T 2 : Insert(001110) BState BState 00 00 00 b 000010 001110 000010 help: op 0 op 0 op 2 a: 0 0 0 0 a: 0 1 0 0 0 1 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  20. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed Make a local copy of the object to update Apply all pending operations on the local object Try making the object globally visible using CAS T 2 : Insert(001110) BState BState 00 00 00 b 000010 000010 001110 help: op 0 op 0 op 2 a: 0 0 0 0 a: 1 0 0 0 1 0 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  21. The PSim algorithm Fatourou and Kallimanis [SPAA’11] Announce the operation to be executed for k in 1..2: Make a local copy of the object to update Apply all pending operations on the local object Try making the object globally visible using CAS T 2 : Insert(001110) BState BState 00 00 00 b 000010 000010 001110 help: op 0 op 0 op 2 a: 0 0 0 0 a: 1 0 0 0 1 0 0 0 t: 1 1 0 0 1 0 0 0 res: res: 11 2018

  22. The hash table structure help: ht prefix =0 00 000010 01 prefix =1 10 100000 11 DState Bucket BState Two levels of indirection One instance of PSim for the DState and for each BState 12 2018

  23. Insert (no resizing) and Lookup operations ht prefix =0 00 000010 01 prefix =1 10 100000 11 T a : Insert(111100) 100000 111100 T b : Lookup(100010) Lookup operations are executed without any synchronization ( BState objects are immutable) Insert operations on different buckets do not synchronize 13 2018

  24. Insert (no resizing) and Lookup operations ht prefix =0 00 000010 01 prefix =1 10 100000 11 T a : Insert(111100) 100000 111100 T b : Lookup(100010) Lookup operations are executed without any synchronization ( BState objects are immutable) Insert operations on different buckets do not synchronize 13 2018

  25. Insert (no resizing) and Lookup operations ht prefix =0 00 000010 01 prefix =1 10 100000 11 T a : Insert(111100) 100000 111100 T b : Lookup(100010) Lookup operations are executed without any synchronization ( BState objects are immutable) Insert operations on different buckets do not synchronize 13 2018

  26. Insert (no resizing) and Lookup operations ht prefix =0 00 000010 01 prefix =1 10 100000 11 T a : Insert(111100) 100000 111100 T b : Lookup(100010) Lookup operations are executed without any synchronization ( BState objects are immutable) Insert operations on different buckets do not synchronize 13 2018

  27. Splitting a bucket ht prefix =0 00 00 000010 01 01 prefix =1 10 10 100000 11 11 111100 00 01 prefix =10 T a : Insert(110011) 100000 10 11 prefix =11 111100 110011 14 2018

  28. Splitting a bucket ht prefix =0 00 00 000010 01 01 prefix =1 10 10 100000 11 11 111100 00 01 prefix =10 T a : Insert(110011) 100000 10 11 prefix =11 111100 110011 14 2018

  29. Splitting a bucket ht prefix =0 00 00 000010 01 01 prefix =1 10 10 100000 11 11 111100 00 01 prefix =10 T a : Insert(110011) 100000 10 11 prefix =11 111100 110011 14 2018

  30. Splitting a bucket ht prefix =0 00 00 000010 01 01 prefix =1 10 10 100000 11 11 111100 00 01 prefix =10 T a : Insert(110011) 100000 10 11 prefix =11 111100 110011 14 2018

  31. Splitting a bucket ht prefix =0 00 00 000010 01 01 prefix =1 10 10 100000 11 11 111100 00 01 prefix =10 T a : Insert(110011) 100000 10 11 prefix =11 111100 110011 To avoid losing updates: Only full buckets can be replaced during resizing No update operation can be run on a full bucket 14 2018

Recommend


More recommend