SlideShare a Scribd company logo
Concurrent Tries with Efficient Non-blocking Snapshots 
Aleksandar Prokopec 
Phil Bagwell 
Martin Odersky 
École Polytechnique Fédérale de Lausanne 
Nathan Bronson 
Stanford
Motivation 
val numbers = getNumbers() 
// compute square roots 
numbers foreach { entry => 
x = entry.root 
n = entry.number 
entry.root = 0.5 * (x + n / x) 
if (abs(entry.root - x) < eps) 
numbers.remove(entry) 
}
Hash Array Mapped Tries (HAMT)
Hash Array Mapped Tries (HAMT) 
0 = 0000002
Hash Array Mapped Tries (HAMT) 
0
Hash Array Mapped Tries (HAMT) 
0 
16 = 0100002
Hash Array Mapped Tries (HAMT) 
0 
16
Hash Array Mapped Tries (HAMT) 
0 
16 
4 = 0001002
Hash Array Mapped Tries (HAMT) 
16 
0 
4 = 0001002
Hash Array Mapped Tries (HAMT) 
16 
0 
4
Hash Array Mapped Tries (HAMT) 
16 
0 
4 
12 = 0011002
Hash Array Mapped Tries (HAMT) 
16 
0 
4 
12 = 0011002
Hash Array Mapped Tries (HAMT) 
16 
0 
4 
12
Hash Array Mapped Tries (HAMT) 
16 
33 
0 
4 
12
Hash Array Mapped Tries (HAMT) 
16 
33 
0 
4 
12 
48
Hash Array Mapped Tries (HAMT) 
16 
0 
4 
12 
48 
33 
37
Hash Array Mapped Tries (HAMT) 
16 
4 
12 
48 
33 
37 
0 
3
Hash Array Mapped Tries (HAMT) 
4 
12 
16 
20 
25 
33 
37 
0 
1 
8 
9 
3 
48 
57
Immutable HAMT 
•used as immutable maps in functional languages 
4 
12 
16 
20 
25 
33 
37 
0 
1 
8 
9 
3
Immutable HAMT 
•updates rewrite path from root to leaf 
4 
12 
16 
20 
25 
33 
37 
0 
1 
8 
9 
3 
4 
12 
8 
9 
11 
insert(11)
Immutable HAMT 
•updates rewrite path from root to leaf 
4 
12 
16 
20 
25 
33 
37 
0 
1 
8 
9 
3 
4 
12 
8 
9 
11 
insert(11) 
efficient updates - logk(n)
Node compression 
48 
57 
48 
57 
1 
0 
1 
0 
48 
57 
1 
0 
1 
0 
48 
57 
10 
BITPOP(((1 << ((hc >> lev) & 1F)) – 1) & BMP)
Node compression 
48 
57 
48 
57 
1 
0 
1 
0 
48 
57 
1 
0 
1 
0 
48 
57 
10 
48 
57
Ctrie 
Can mutable HAMT be modified to be 
thread-safe?
Ctrie insert 
4 
9 
12 
16 
20 
25 
33 
37 
0 
1 
3 
48 
57 
17 = 0100012
Ctrie insert 
4 
9 
12 
16 
20 
25 
33 
37 
0 
1 
3 
48 
57 
17 = 0100012 
16 
17 
1) allocate
Ctrie insert 
4 
9 
12 
20 
25 
33 
37 
0 
1 
3 
48 
57 
17 = 0100012 
16 
17 
2) CAS
Ctrie insert 
4 
9 
12 
20 
25 
33 
37 
0 
1 
3 
48 
57 
17 = 0100012 
16 
17
Ctrie insert 
4 
9 
12 
33 
37 
0 
1 
3 
48 
57 
18 = 0100102 
16 
17 
20 
25
Ctrie insert 
4 
9 
12 
33 
37 
0 
1 
3 
48 
57 
18 = 0100102 
16 
17 
20 
25 
1) allocate 
16 
17 
18
Ctrie insert 
4 
9 
12 
33 
37 
0 
1 
3 
48 
57 
18 = 0100102 
20 
25 
2) CAS 
16 
17 
18
Ctrie insert 
4 
9 
12 
33 
37 
0 
1 
3 
48 
57 
18 = 0100102 
20 
25 
2) CAS 
16 
17 
18 
Unless…
Ctrie insert 
4 
9 
12 
33 
37 
0 
1 
3 
48 
57 
18 = 0100102 
16 
17 
20 
25 
T1-1) allocate 
16 
17 
18 
Unless… 
28 = 0111002 
T1 
T2
Ctrie insert 
4 
9 
12 
0 
1 
3 
18 = 0100102 
16 
17 
20 
25 
T1-1) allocate 
16 
17 
18 
Unless… 
28 = 0111002 
T1 
T2 
20 
25 
28 
T2-1) allocate
Ctrie insert 
4 
9 
12 
0 
1 
3 
18 = 0100102 
16 
17 
20 
25 
T1-1) allocate 
16 
17 
18 
28 = 0111002 
T1 
T2 
20 
25 
28 
T2-2) CAS
Ctrie insert 
4 
9 
12 
0 
1 
3 
18 = 0100102 
16 
17 
20 
25 
T1-2) CAS 
16 
17 
18 
28 = 0111002 
T1 
T2 
20 
25 
28 
T2-2) CAS
Ctrie insert 
4 
9 
12 
0 
1 
3 
18 = 0100102 
16 
17 
20 
25 
16 
17 
18 
28 = 0111002 
T1 
T2 
20 
25 
28 
Lost insert!
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
20 
25 
Solution: I-nodes
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
20 
25 
18 = 0100102 
28 = 0111002 
T1 
T2
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
T1 
T2 
20 
25 
18 = 0100102 
28 = 0111002 
16 
17 
18 
20 
25 
28 
T2-1) allocate 
T1-1) allocate
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
T1 
T2 
20 
25 
16 
17 
18 
20 
25 
28 
T2-2) CAS 
T1-2) CAS
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
Idea: once added to the Ctrie, I-nodes remain present.
Ctrie insert – 2nd attempt 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
Remove operation supported as well - details in the paper.
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 0
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 0
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 0
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 0
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 1
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 2
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 3
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 5
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 5 
actual size = 12
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 5 
0 
1 
actual size = 12
Ctrie size 
4 
9 
12 
0 
1 
3 
16 
17 
18 
20 
25 
28 
size = 5 
0 
1 
CAS 
actual size = 11
Ctrie size 
4 
9 
12 
16 
17 
18 
20 
25 
28 
size = 5 
0 
1 
actual size = 11
Ctrie size 
4 
9 
12 
16 
17 
18 
20 
25 
28 
size = 6 
0 
1 
actual size = 11
Ctrie size 
4 
9 
12 
16 
17 
18 
20 
25 
28 
size = 6 
0 
1 
actual size = 11 
19
Ctrie size 
4 
9 
12 
16 
17 
18 
20 
25 
28 
size = 6 
0 
1 
actual size = 11 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
16 
17 
18 
20 
25 
28 
size = 6 
0 
1 
actual size = 12 
16 
17 
18 
19 
CAS
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 6 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 6 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 7 
0 
1 
actual size = 9 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 8 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 9 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 10 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 11 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 12 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 13 
0 
1 
actual size = 12 
16 
17 
18 
19
Ctrie size 
4 
9 
12 
20 
25 
28 
size = 13 
0 
1 
actual size = 12 
16 
17 
18 
19 
But the size 
was never 13!
Global state information 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•size 
•find 
•filter 
•iterator
Global state information 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•size 
•find 
•filter 
•iterator 
 snapshot
Snapshot using locks 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19
Snapshot using locks 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•copy expensive
Snapshot using locks 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•copy expensive 
•not lock-free
Snapshot using locks 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•copy expensive 
•not lock-free 
•can insert or remove remain lock-free? 
0 
1 
2 
CAS
Snapshot using locks 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•copy expensive 
•not lock-free 
•can insert or remove remain lock-free? 
0 
1 
2 
CAS
Snapshot using logs 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•keep a linked list of previous values in each I-node
Snapshot using logs 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
0 
1 
2 
•keep a linked list of previous values in each I-node
Snapshot using logs 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
•keep a linked list of previous values in each I-node 
•when is it safe to delete old entries? 
0 
1 
2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
root
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
root
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
snapshot! 
root
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
snapshot! 
#2 
root 
1) create new I-node at #2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
snapshot! 
#2 
root 
2) set snapshot 
snapshot #1
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
snapshot! 
#2 
root 
3) CAS root to new I-node 
snapshot #1
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2 
generation #2 - ok!
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2 
generation #1 
not ok, too old!
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
1) create updated node at #2 
snapshot #1 
2 
#2 
#2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
2) CAS to the updated node 
snapshot #1 
2 
#2 
#2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2 
#2 
#2 
#1 too old!
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2 
#2 
#2 
4 
9 
12 
#2 
1) create updated node at #2
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
2 
#2 
#2 
4 
9 
12 
#2 
2) CAS
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
subsequent insert 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
finally, create a new leaf 
and CAS
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
another insert 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
another insert 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
But... this won't really work... why? 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
CAS
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
CAS 
How to fail this last CAS?
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
DCAS 
How to fail this last CAS? 
DCAS
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
How to fail this last CAS? 
DCAS - software based 
DCAS
Snapshot using immutability 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
How to fail this last CAS? 
DCAS - software based 
...creates intermediate objects 
DCAS
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
prev 
1) set prev field
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
prev 
2) CAS
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
T2: remove 19 
16 
17 
18 
prev 
3) read root generation
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
16 
17 
18 
prev 
4) if root generation changed 
CAS prev to FailedNode(prev) 
FN
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
16 
17 
18 
prev 
4) if root generation changed 
CAS prev to FailedNode(prev) 
FN
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
16 
17 
18 
prev 
5) CAS to previous value 
FN
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
16 
17 
18 
prev 
4) if root generation unchanged 
CAS prev to null
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
16 
17 
18 
4) if root generation unchanged 
CAS prev to null
GCAS - generation-compare-and-swap 
4 
9 
12 
20 
25 
28 
0 
1 
16 
17 
18 
19 
#1 
#1 
#1 
#1 
#1 
#2 
root 
snapshot #1 
#2 
#2 
4 
9 
12 
#2 
0 
1 
2 
3 
1) Replace all CAS with GCAS 
2) Replace all READ with GCAS_READ 
(which checks if prev field is null)
Snapshot-based iterator 
def iterator = 
if (isSnapshot) new Iterator(root) 
else snapshot().iterator()
Snapshot-based size 
def size = { 
val sz = 0 
val it = iterator 
while (it.hasNext) sz += 1 
sz 
}
Snapshot-based size 
def size = { 
val sz = 0 
val it = iterator 
while (it.hasNext) sz += 1 
sz 
} 
Above is O(n). 
But, by caching size in nodes - amortized O(logkn)! 
(see source code)
Snapshot-based atomic clear 
def clear() = { 
val or = READ(root) 
val nr = new INode(new Gen) 
if (!CAS(root, or, nr)) clear() 
} 
(roughly)
Evaluation - quad core i7
Evaluation – UltraSPARC T2
Evaluation – 4x 8-core i7
Evaluation – snapshot
Conclusion 
•snapshots are linearizable and lock-free 
•snapshots take constant time 
•snapshots are horizontally scalable 
•snapshots add a non-significant overhead to the algorithm if they aren't used 
•the approach may be applicable to tree-based lock-free data-structures in general (intuition)
Thank you!

More Related Content

What's hot

Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Counting Unique Users in Real-Time: Here's a Challenge for You!
Counting Unique Users in Real-Time: Here's a Challenge for You!Counting Unique Users in Real-Time: Here's a Challenge for You!
Counting Unique Users in Real-Time: Here's a Challenge for You!
DataWorks Summit
 
Oracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High AvailabilityOracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High Availability
Markus Michalewicz
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
Oddbjørn Steffensen
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cache
Alluxio, Inc.
 
PostgreSQL at 20TB and Beyond
PostgreSQL at 20TB and BeyondPostgreSQL at 20TB and Beyond
PostgreSQL at 20TB and Beyond
Chris Travers
 
The Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago MolaThe Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago Mola
Spark Summit
 
Apache Spark Introduction
Apache Spark IntroductionApache Spark Introduction
Apache Spark Introduction
sudhakara st
 
Physical Plans in Spark SQL
Physical Plans in Spark SQLPhysical Plans in Spark SQL
Physical Plans in Spark SQL
Databricks
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
Databricks
 
Speed up UDFs with GPUs using the RAPIDS Accelerator
Speed up UDFs with GPUs using the RAPIDS AcceleratorSpeed up UDFs with GPUs using the RAPIDS Accelerator
Speed up UDFs with GPUs using the RAPIDS Accelerator
Databricks
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
Kenny Gryp
 
하둡 맵리듀스 훑어보기
하둡 맵리듀스 훑어보기하둡 맵리듀스 훑어보기
하둡 맵리듀스 훑어보기
beom kyun choi
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
Wagner Bianchi
 
Solaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and TuningSolaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and Tuning
Adrian Cockcroft
 
Dynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache SparkDynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache Spark
Databricks
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Nelson Calero
 
Productionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job ServerProductionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job Server
Evan Chan
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage Engines
Karthik .P.R
 
02-Active Directory Domain Services.pptx
02-Active Directory Domain Services.pptx02-Active Directory Domain Services.pptx
02-Active Directory Domain Services.pptx
AdiWidyanto2
 

What's hot (20)

Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
Counting Unique Users in Real-Time: Here's a Challenge for You!
Counting Unique Users in Real-Time: Here's a Challenge for You!Counting Unique Users in Real-Time: Here's a Challenge for You!
Counting Unique Users in Real-Time: Here's a Challenge for You!
 
Oracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High AvailabilityOracle Cloud is Best for Oracle Database - High Availability
Oracle Cloud is Best for Oracle Database - High Availability
 
Get to know PostgreSQL!
Get to know PostgreSQL!Get to know PostgreSQL!
Get to know PostgreSQL!
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cache
 
PostgreSQL at 20TB and Beyond
PostgreSQL at 20TB and BeyondPostgreSQL at 20TB and Beyond
PostgreSQL at 20TB and Beyond
 
The Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago MolaThe Pushdown of Everything by Stephan Kessler and Santiago Mola
The Pushdown of Everything by Stephan Kessler and Santiago Mola
 
Apache Spark Introduction
Apache Spark IntroductionApache Spark Introduction
Apache Spark Introduction
 
Physical Plans in Spark SQL
Physical Plans in Spark SQLPhysical Plans in Spark SQL
Physical Plans in Spark SQL
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Speed up UDFs with GPUs using the RAPIDS Accelerator
Speed up UDFs with GPUs using the RAPIDS AcceleratorSpeed up UDFs with GPUs using the RAPIDS Accelerator
Speed up UDFs with GPUs using the RAPIDS Accelerator
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
하둡 맵리듀스 훑어보기
하둡 맵리듀스 훑어보기하둡 맵리듀스 훑어보기
하둡 맵리듀스 훑어보기
 
Maxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoinMaxscale switchover, failover, and auto rejoin
Maxscale switchover, failover, and auto rejoin
 
Solaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and TuningSolaris Linux Performance, Tools and Tuning
Solaris Linux Performance, Tools and Tuning
 
Dynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache SparkDynamic Partition Pruning in Apache Spark
Dynamic Partition Pruning in Apache Spark
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
 
Productionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job ServerProductionizing Spark and the Spark Job Server
Productionizing Spark and the Spark Job Server
 
MySQL Storage Engines
MySQL Storage EnginesMySQL Storage Engines
MySQL Storage Engines
 
02-Active Directory Domain Services.pptx
02-Active Directory Domain Services.pptx02-Active Directory Domain Services.pptx
02-Active Directory Domain Services.pptx
 

Similar to Ctrie Data Structure

LEC 8-DS ALGO(heaps).pdf
LEC 8-DS  ALGO(heaps).pdfLEC 8-DS  ALGO(heaps).pdf
LEC 8-DS ALGO(heaps).pdf
MuhammadUmerIhtisham
 
Ethereum 9¾ @ Devcon5
Ethereum 9¾ @ Devcon5Ethereum 9¾ @ Devcon5
Ethereum 9¾ @ Devcon5
Wanseob Lim
 
Fast and accurate metrics. Is it actually possible?
Fast and accurate metrics. Is it actually possible?Fast and accurate metrics. Is it actually possible?
Fast and accurate metrics. Is it actually possible?
Bogdan Storozhuk
 
Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques
Alexander Litvinenko
 
Complete Factoring Rules.ppt
Complete Factoring Rules.pptComplete Factoring Rules.ppt
Complete Factoring Rules.ppt
Jasmin679773
 
Complete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.pptComplete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.ppt
ElmabethDelaCruz2
 
Single elctron transisto PHASE 2.pptx
Single elctron transisto PHASE 2.pptxSingle elctron transisto PHASE 2.pptx
Single elctron transisto PHASE 2.pptx
ssuser1580e5
 
Applied Econometrics assignment3
Applied Econometrics assignment3Applied Econometrics assignment3
Applied Econometrics assignment3
Chenguang Li
 
Identification of unknown parameters and prediction with hierarchical matrice...
Identification of unknown parameters and prediction with hierarchical matrice...Identification of unknown parameters and prediction with hierarchical matrice...
Identification of unknown parameters and prediction with hierarchical matrice...
Alexander Litvinenko
 
Identification of unknown parameters and prediction of missing values. Compar...
Identification of unknown parameters and prediction of missing values. Compar...Identification of unknown parameters and prediction of missing values. Compar...
Identification of unknown parameters and prediction of missing values. Compar...
Alexander Litvinenko
 
SPSF03 - Numerical Integrations
SPSF03 - Numerical IntegrationsSPSF03 - Numerical Integrations
SPSF03 - Numerical Integrations
Syeilendra Pramuditya
 
Insertion Sort Algorithm
Insertion Sort AlgorithmInsertion Sort Algorithm
Insertion Sort Algorithm
Gail Carmichael
 
PORTIQUE VERIF
PORTIQUE VERIFPORTIQUE VERIF
Drawing Frequency Histogram Polygon
Drawing Frequency Histogram PolygonDrawing Frequency Histogram Polygon
Drawing Frequency Histogram Polygon
Moonie Kim
 
Cassandra : to be or not to be @ TechTalk
Cassandra : to be or not to be @ TechTalkCassandra : to be or not to be @ TechTalk
Cassandra : to be or not to be @ TechTalk
Andriy Rymar
 
Sua chua may lanh cua daikin
Sua chua may lanh cua daikinSua chua may lanh cua daikin
Sua chua may lanh cua daikin
suadiennuochanoi.vn
 
Application of parallel hierarchical matrices for parameter inference and pre...
Application of parallel hierarchical matrices for parameter inference and pre...Application of parallel hierarchical matrices for parameter inference and pre...
Application of parallel hierarchical matrices for parameter inference and pre...
Alexander Litvinenko
 
die diesem Kleid ein so romantisches Gefühl verleihen
die diesem Kleid ein so romantisches Gefühl verleihendie diesem Kleid ein so romantisches Gefühl verleihen
die diesem Kleid ein so romantisches Gefühl verleihen
mokleider lee
 
Ihre Freundschaftstraditionen zu feiern und zu festigen
Ihre Freundschaftstraditionen zu feiern und zu festigenIhre Freundschaftstraditionen zu feiern und zu festigen
Ihre Freundschaftstraditionen zu feiern und zu festigen
mokleider lee
 
K means clustering
K means clusteringK means clustering
K means clustering
Kuppusamy P
 

Similar to Ctrie Data Structure (20)

LEC 8-DS ALGO(heaps).pdf
LEC 8-DS  ALGO(heaps).pdfLEC 8-DS  ALGO(heaps).pdf
LEC 8-DS ALGO(heaps).pdf
 
Ethereum 9¾ @ Devcon5
Ethereum 9¾ @ Devcon5Ethereum 9¾ @ Devcon5
Ethereum 9¾ @ Devcon5
 
Fast and accurate metrics. Is it actually possible?
Fast and accurate metrics. Is it actually possible?Fast and accurate metrics. Is it actually possible?
Fast and accurate metrics. Is it actually possible?
 
Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques
 
Complete Factoring Rules.ppt
Complete Factoring Rules.pptComplete Factoring Rules.ppt
Complete Factoring Rules.ppt
 
Complete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.pptComplete Factoring Rules in Grade 8 Math.ppt
Complete Factoring Rules in Grade 8 Math.ppt
 
Single elctron transisto PHASE 2.pptx
Single elctron transisto PHASE 2.pptxSingle elctron transisto PHASE 2.pptx
Single elctron transisto PHASE 2.pptx
 
Applied Econometrics assignment3
Applied Econometrics assignment3Applied Econometrics assignment3
Applied Econometrics assignment3
 
Identification of unknown parameters and prediction with hierarchical matrice...
Identification of unknown parameters and prediction with hierarchical matrice...Identification of unknown parameters and prediction with hierarchical matrice...
Identification of unknown parameters and prediction with hierarchical matrice...
 
Identification of unknown parameters and prediction of missing values. Compar...
Identification of unknown parameters and prediction of missing values. Compar...Identification of unknown parameters and prediction of missing values. Compar...
Identification of unknown parameters and prediction of missing values. Compar...
 
SPSF03 - Numerical Integrations
SPSF03 - Numerical IntegrationsSPSF03 - Numerical Integrations
SPSF03 - Numerical Integrations
 
Insertion Sort Algorithm
Insertion Sort AlgorithmInsertion Sort Algorithm
Insertion Sort Algorithm
 
PORTIQUE VERIF
PORTIQUE VERIFPORTIQUE VERIF
PORTIQUE VERIF
 
Drawing Frequency Histogram Polygon
Drawing Frequency Histogram PolygonDrawing Frequency Histogram Polygon
Drawing Frequency Histogram Polygon
 
Cassandra : to be or not to be @ TechTalk
Cassandra : to be or not to be @ TechTalkCassandra : to be or not to be @ TechTalk
Cassandra : to be or not to be @ TechTalk
 
Sua chua may lanh cua daikin
Sua chua may lanh cua daikinSua chua may lanh cua daikin
Sua chua may lanh cua daikin
 
Application of parallel hierarchical matrices for parameter inference and pre...
Application of parallel hierarchical matrices for parameter inference and pre...Application of parallel hierarchical matrices for parameter inference and pre...
Application of parallel hierarchical matrices for parameter inference and pre...
 
die diesem Kleid ein so romantisches Gefühl verleihen
die diesem Kleid ein so romantisches Gefühl verleihendie diesem Kleid ein so romantisches Gefühl verleihen
die diesem Kleid ein so romantisches Gefühl verleihen
 
Ihre Freundschaftstraditionen zu feiern und zu festigen
Ihre Freundschaftstraditionen zu feiern und zu festigenIhre Freundschaftstraditionen zu feiern und zu festigen
Ihre Freundschaftstraditionen zu feiern und zu festigen
 
K means clustering
K means clusteringK means clustering
K means clustering
 

More from Aleksandar Prokopec

Work-stealing Tree Data Structure
Work-stealing Tree Data StructureWork-stealing Tree Data Structure
Work-stealing Tree Data Structure
Aleksandar Prokopec
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
Aleksandar Prokopec
 
ScalaBlitz
ScalaBlitzScalaBlitz
Scala Parallel Collections
Scala Parallel CollectionsScala Parallel Collections
Scala Parallel Collections
Aleksandar Prokopec
 
ScalaMeter 2014
ScalaMeter 2014ScalaMeter 2014
ScalaMeter 2014
Aleksandar Prokopec
 
ScalaMeter 2012
ScalaMeter 2012ScalaMeter 2012
ScalaMeter 2012
Aleksandar Prokopec
 
Reactive Collections
Reactive CollectionsReactive Collections
Reactive Collections
Aleksandar Prokopec
 
ScalaDays 2014 - Reactive Scala 3D Game Engine
ScalaDays 2014 - Reactive Scala 3D Game Engine ScalaDays 2014 - Reactive Scala 3D Game Engine
ScalaDays 2014 - Reactive Scala 3D Game Engine
Aleksandar Prokopec
 

More from Aleksandar Prokopec (8)

Work-stealing Tree Data Structure
Work-stealing Tree Data StructureWork-stealing Tree Data Structure
Work-stealing Tree Data Structure
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
ScalaBlitz
ScalaBlitzScalaBlitz
ScalaBlitz
 
Scala Parallel Collections
Scala Parallel CollectionsScala Parallel Collections
Scala Parallel Collections
 
ScalaMeter 2014
ScalaMeter 2014ScalaMeter 2014
ScalaMeter 2014
 
ScalaMeter 2012
ScalaMeter 2012ScalaMeter 2012
ScalaMeter 2012
 
Reactive Collections
Reactive CollectionsReactive Collections
Reactive Collections
 
ScalaDays 2014 - Reactive Scala 3D Game Engine
ScalaDays 2014 - Reactive Scala 3D Game Engine ScalaDays 2014 - Reactive Scala 3D Game Engine
ScalaDays 2014 - Reactive Scala 3D Game Engine
 

Recently uploaded

Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
ssuserad3af4
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
devvsandy
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 

Recently uploaded (20)

Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
316895207-SAP-Oil-and-Gas-Downstream-Training.pptx
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Top 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptxTop 9 Trends in Cybersecurity for 2024.pptx
Top 9 Trends in Cybersecurity for 2024.pptx
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 

Ctrie Data Structure

  • 1. Concurrent Tries with Efficient Non-blocking Snapshots Aleksandar Prokopec Phil Bagwell Martin Odersky École Polytechnique Fédérale de Lausanne Nathan Bronson Stanford
  • 2. Motivation val numbers = getNumbers() // compute square roots numbers foreach { entry => x = entry.root n = entry.number entry.root = 0.5 * (x + n / x) if (abs(entry.root - x) < eps) numbers.remove(entry) }
  • 3. Hash Array Mapped Tries (HAMT)
  • 4. Hash Array Mapped Tries (HAMT) 0 = 0000002
  • 5. Hash Array Mapped Tries (HAMT) 0
  • 6. Hash Array Mapped Tries (HAMT) 0 16 = 0100002
  • 7. Hash Array Mapped Tries (HAMT) 0 16
  • 8. Hash Array Mapped Tries (HAMT) 0 16 4 = 0001002
  • 9. Hash Array Mapped Tries (HAMT) 16 0 4 = 0001002
  • 10. Hash Array Mapped Tries (HAMT) 16 0 4
  • 11. Hash Array Mapped Tries (HAMT) 16 0 4 12 = 0011002
  • 12. Hash Array Mapped Tries (HAMT) 16 0 4 12 = 0011002
  • 13. Hash Array Mapped Tries (HAMT) 16 0 4 12
  • 14. Hash Array Mapped Tries (HAMT) 16 33 0 4 12
  • 15. Hash Array Mapped Tries (HAMT) 16 33 0 4 12 48
  • 16. Hash Array Mapped Tries (HAMT) 16 0 4 12 48 33 37
  • 17. Hash Array Mapped Tries (HAMT) 16 4 12 48 33 37 0 3
  • 18. Hash Array Mapped Tries (HAMT) 4 12 16 20 25 33 37 0 1 8 9 3 48 57
  • 19. Immutable HAMT •used as immutable maps in functional languages 4 12 16 20 25 33 37 0 1 8 9 3
  • 20. Immutable HAMT •updates rewrite path from root to leaf 4 12 16 20 25 33 37 0 1 8 9 3 4 12 8 9 11 insert(11)
  • 21. Immutable HAMT •updates rewrite path from root to leaf 4 12 16 20 25 33 37 0 1 8 9 3 4 12 8 9 11 insert(11) efficient updates - logk(n)
  • 22. Node compression 48 57 48 57 1 0 1 0 48 57 1 0 1 0 48 57 10 BITPOP(((1 << ((hc >> lev) & 1F)) – 1) & BMP)
  • 23. Node compression 48 57 48 57 1 0 1 0 48 57 1 0 1 0 48 57 10 48 57
  • 24. Ctrie Can mutable HAMT be modified to be thread-safe?
  • 25. Ctrie insert 4 9 12 16 20 25 33 37 0 1 3 48 57 17 = 0100012
  • 26. Ctrie insert 4 9 12 16 20 25 33 37 0 1 3 48 57 17 = 0100012 16 17 1) allocate
  • 27. Ctrie insert 4 9 12 20 25 33 37 0 1 3 48 57 17 = 0100012 16 17 2) CAS
  • 28. Ctrie insert 4 9 12 20 25 33 37 0 1 3 48 57 17 = 0100012 16 17
  • 29. Ctrie insert 4 9 12 33 37 0 1 3 48 57 18 = 0100102 16 17 20 25
  • 30. Ctrie insert 4 9 12 33 37 0 1 3 48 57 18 = 0100102 16 17 20 25 1) allocate 16 17 18
  • 31. Ctrie insert 4 9 12 33 37 0 1 3 48 57 18 = 0100102 20 25 2) CAS 16 17 18
  • 32. Ctrie insert 4 9 12 33 37 0 1 3 48 57 18 = 0100102 20 25 2) CAS 16 17 18 Unless…
  • 33. Ctrie insert 4 9 12 33 37 0 1 3 48 57 18 = 0100102 16 17 20 25 T1-1) allocate 16 17 18 Unless… 28 = 0111002 T1 T2
  • 34. Ctrie insert 4 9 12 0 1 3 18 = 0100102 16 17 20 25 T1-1) allocate 16 17 18 Unless… 28 = 0111002 T1 T2 20 25 28 T2-1) allocate
  • 35. Ctrie insert 4 9 12 0 1 3 18 = 0100102 16 17 20 25 T1-1) allocate 16 17 18 28 = 0111002 T1 T2 20 25 28 T2-2) CAS
  • 36. Ctrie insert 4 9 12 0 1 3 18 = 0100102 16 17 20 25 T1-2) CAS 16 17 18 28 = 0111002 T1 T2 20 25 28 T2-2) CAS
  • 37. Ctrie insert 4 9 12 0 1 3 18 = 0100102 16 17 20 25 16 17 18 28 = 0111002 T1 T2 20 25 28 Lost insert!
  • 38. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 20 25 Solution: I-nodes
  • 39. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 20 25 18 = 0100102 28 = 0111002 T1 T2
  • 40. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 T1 T2 20 25 18 = 0100102 28 = 0111002 16 17 18 20 25 28 T2-1) allocate T1-1) allocate
  • 41. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 T1 T2 20 25 16 17 18 20 25 28 T2-2) CAS T1-2) CAS
  • 42. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 18 20 25 28
  • 43. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 18 20 25 28 Idea: once added to the Ctrie, I-nodes remain present.
  • 44. Ctrie insert – 2nd attempt 4 9 12 0 1 3 16 17 18 20 25 28 Remove operation supported as well - details in the paper.
  • 45. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28
  • 46. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 0
  • 47. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 0
  • 48. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 0
  • 49. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 0
  • 50. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 1
  • 51. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 2
  • 52. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 3
  • 53. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 5
  • 54. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 5 actual size = 12
  • 55. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 5 0 1 actual size = 12
  • 56. Ctrie size 4 9 12 0 1 3 16 17 18 20 25 28 size = 5 0 1 CAS actual size = 11
  • 57. Ctrie size 4 9 12 16 17 18 20 25 28 size = 5 0 1 actual size = 11
  • 58. Ctrie size 4 9 12 16 17 18 20 25 28 size = 6 0 1 actual size = 11
  • 59. Ctrie size 4 9 12 16 17 18 20 25 28 size = 6 0 1 actual size = 11 19
  • 60. Ctrie size 4 9 12 16 17 18 20 25 28 size = 6 0 1 actual size = 11 16 17 18 19
  • 61. Ctrie size 4 9 12 16 17 18 20 25 28 size = 6 0 1 actual size = 12 16 17 18 19 CAS
  • 62. Ctrie size 4 9 12 20 25 28 size = 6 0 1 actual size = 12 16 17 18 19
  • 63. Ctrie size 4 9 12 20 25 28 size = 6 0 1 actual size = 12 16 17 18 19
  • 64. Ctrie size 4 9 12 20 25 28 size = 7 0 1 actual size = 9 16 17 18 19
  • 65. Ctrie size 4 9 12 20 25 28 size = 8 0 1 actual size = 12 16 17 18 19
  • 66. Ctrie size 4 9 12 20 25 28 size = 9 0 1 actual size = 12 16 17 18 19
  • 67. Ctrie size 4 9 12 20 25 28 size = 10 0 1 actual size = 12 16 17 18 19
  • 68. Ctrie size 4 9 12 20 25 28 size = 11 0 1 actual size = 12 16 17 18 19
  • 69. Ctrie size 4 9 12 20 25 28 size = 12 0 1 actual size = 12 16 17 18 19
  • 70. Ctrie size 4 9 12 20 25 28 size = 13 0 1 actual size = 12 16 17 18 19
  • 71. Ctrie size 4 9 12 20 25 28 size = 13 0 1 actual size = 12 16 17 18 19 But the size was never 13!
  • 72. Global state information 4 9 12 20 25 28 0 1 16 17 18 19 •size •find •filter •iterator
  • 73. Global state information 4 9 12 20 25 28 0 1 16 17 18 19 •size •find •filter •iterator  snapshot
  • 74. Snapshot using locks 4 9 12 20 25 28 0 1 16 17 18 19
  • 75. Snapshot using locks 4 9 12 20 25 28 0 1 16 17 18 19 •copy expensive
  • 76. Snapshot using locks 4 9 12 20 25 28 0 1 16 17 18 19 •copy expensive •not lock-free
  • 77. Snapshot using locks 4 9 12 20 25 28 0 1 16 17 18 19 •copy expensive •not lock-free •can insert or remove remain lock-free? 0 1 2 CAS
  • 78. Snapshot using locks 4 9 12 20 25 28 0 1 16 17 18 19 •copy expensive •not lock-free •can insert or remove remain lock-free? 0 1 2 CAS
  • 79. Snapshot using logs 4 9 12 20 25 28 0 1 16 17 18 19 •keep a linked list of previous values in each I-node
  • 80. Snapshot using logs 4 9 12 20 25 28 0 1 16 17 18 19 0 1 2 •keep a linked list of previous values in each I-node
  • 81. Snapshot using logs 4 9 12 20 25 28 0 1 16 17 18 19 •keep a linked list of previous values in each I-node •when is it safe to delete old entries? 0 1 2
  • 82. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 root
  • 83. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 root
  • 84. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 snapshot! root
  • 85. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 snapshot! #2 root 1) create new I-node at #2
  • 86. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 snapshot! #2 root 2) set snapshot snapshot #1
  • 87. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 snapshot! #2 root 3) CAS root to new I-node snapshot #1
  • 88. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2
  • 89. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2 generation #2 - ok!
  • 90. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2 generation #1 not ok, too old!
  • 91. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root 1) create updated node at #2 snapshot #1 2 #2 #2
  • 92. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root 2) CAS to the updated node snapshot #1 2 #2 #2
  • 93. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2 #2 #2 #1 too old!
  • 94. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2 #2 #2 4 9 12 #2 1) create updated node at #2
  • 95. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 2 #2 #2 4 9 12 #2 2) CAS
  • 96. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 subsequent insert #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 finally, create a new leaf and CAS
  • 97. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 another insert #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3
  • 98. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 another insert #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3
  • 99. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 But... this won't really work... why? #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3
  • 100. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18
  • 101. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18 CAS
  • 102. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18 CAS How to fail this last CAS?
  • 103. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18 DCAS How to fail this last CAS? DCAS
  • 104. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18 How to fail this last CAS? DCAS - software based DCAS
  • 105. Snapshot using immutability 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 0 1 2 3 T2: remove 19 16 17 18 How to fail this last CAS? DCAS - software based ...creates intermediate objects DCAS
  • 106. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 T2: remove 19 16 17 18 prev 1) set prev field
  • 107. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 T2: remove 19 16 17 18 prev 2) CAS
  • 108. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 T2: remove 19 16 17 18 prev 3) read root generation
  • 109. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 16 17 18 prev 4) if root generation changed CAS prev to FailedNode(prev) FN
  • 110. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 16 17 18 prev 4) if root generation changed CAS prev to FailedNode(prev) FN
  • 111. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 16 17 18 prev 5) CAS to previous value FN
  • 112. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 16 17 18 prev 4) if root generation unchanged CAS prev to null
  • 113. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 16 17 18 4) if root generation unchanged CAS prev to null
  • 114. GCAS - generation-compare-and-swap 4 9 12 20 25 28 0 1 16 17 18 19 #1 #1 #1 #1 #1 #2 root snapshot #1 #2 #2 4 9 12 #2 0 1 2 3 1) Replace all CAS with GCAS 2) Replace all READ with GCAS_READ (which checks if prev field is null)
  • 115. Snapshot-based iterator def iterator = if (isSnapshot) new Iterator(root) else snapshot().iterator()
  • 116. Snapshot-based size def size = { val sz = 0 val it = iterator while (it.hasNext) sz += 1 sz }
  • 117. Snapshot-based size def size = { val sz = 0 val it = iterator while (it.hasNext) sz += 1 sz } Above is O(n). But, by caching size in nodes - amortized O(logkn)! (see source code)
  • 118. Snapshot-based atomic clear def clear() = { val or = READ(root) val nr = new INode(new Gen) if (!CAS(root, or, nr)) clear() } (roughly)
  • 119. Evaluation - quad core i7
  • 121. Evaluation – 4x 8-core i7
  • 123. Conclusion •snapshots are linearizable and lock-free •snapshots take constant time •snapshots are horizontally scalable •snapshots add a non-significant overhead to the algorithm if they aren't used •the approach may be applicable to tree-based lock-free data-structures in general (intuition)