Practical Concerns for Scalable Synchronization Josh Triplett May - - PowerPoint PPT Presentation

practical concerns for scalable synchronization
SMART_READER_LITE
LIVE PREVIEW

Practical Concerns for Scalable Synchronization Josh Triplett May - - PowerPoint PPT Presentation

Practical Concerns for Scalable Synchronization Josh Triplett May 10, 2006 The basic problem Operating systems need concurrency Operating systems need shared data structures The basic problem Operating systems need concurrency


slide-1
SLIDE 1

Practical Concerns for Scalable Synchronization

Josh Triplett May 10, 2006

slide-2
SLIDE 2

The basic problem

  • Operating systems need concurrency
  • Operating systems need shared data structures
slide-3
SLIDE 3

The basic problem

  • Operating systems need concurrency
  • Operating systems need shared data structures
slide-4
SLIDE 4

Mutual exclusion?

  • Readers and writers acquire a lock
  • Doesn’t scale
  • High contention
  • Priority inversion
  • Deadlock
slide-5
SLIDE 5

Mutual exclusion?

  • Readers and writers acquire a lock
  • Doesn’t scale
  • High contention
  • Priority inversion
  • Deadlock
slide-6
SLIDE 6

Mutual exclusion?

  • Readers and writers acquire a lock
  • Doesn’t scale
  • High contention
  • Priority inversion
  • Deadlock
slide-7
SLIDE 7

Mutual exclusion?

  • Readers and writers acquire a lock
  • Doesn’t scale
  • High contention
  • Priority inversion
  • Deadlock
slide-8
SLIDE 8

Mutual exclusion?

  • Readers and writers acquire a lock
  • Doesn’t scale
  • High contention
  • Priority inversion
  • Deadlock
slide-9
SLIDE 9

Speed up contended case

  • Better spin locks
  • Queuing locks
  • How much does the high-contention case matter?
slide-10
SLIDE 10

Speed up contended case

  • Better spin locks
  • Queuing locks
  • How much does the high-contention case matter?
slide-11
SLIDE 11

Speed up contended case

  • Better spin locks
  • Queuing locks
  • How much does the high-contention case matter?
slide-12
SLIDE 12

Reduce contention

  • Contention-reducing data structures (two-lock queue)
  • Reader-writer locking
  • Localizing data to avoid sharing or false sharing
slide-13
SLIDE 13

Reduce contention

  • Contention-reducing data structures (two-lock queue)
  • Reader-writer locking
  • Localizing data to avoid sharing or false sharing
slide-14
SLIDE 14

Reduce contention

  • Contention-reducing data structures (two-lock queue)
  • Reader-writer locking
  • Localizing data to avoid sharing or false sharing
slide-15
SLIDE 15

Contention less relevant

  • Atomic instructions expensive
  • Memory barriers expensive
  • 3 orders of magnitude worse than regular instruction
  • For locking, lock maintenance time dominates
  • For non-blocking synchronization, CAS or LL/SC time

dominates

slide-16
SLIDE 16

Contention less relevant

  • Atomic instructions expensive
  • Memory barriers expensive
  • 3 orders of magnitude worse than regular instruction
  • For locking, lock maintenance time dominates
  • For non-blocking synchronization, CAS or LL/SC time

dominates

slide-17
SLIDE 17

Contention less relevant

  • Atomic instructions expensive
  • Memory barriers expensive
  • 3 orders of magnitude worse than regular instruction
  • For locking, lock maintenance time dominates
  • For non-blocking synchronization, CAS or LL/SC time

dominates

slide-18
SLIDE 18

Contention less relevant

  • Atomic instructions expensive
  • Memory barriers expensive
  • 3 orders of magnitude worse than regular instruction
  • For locking, lock maintenance time dominates
  • For non-blocking synchronization, CAS or LL/SC time

dominates

slide-19
SLIDE 19

Contention less relevant

  • Atomic instructions expensive
  • Memory barriers expensive
  • 3 orders of magnitude worse than regular instruction
  • For locking, lock maintenance time dominates
  • For non-blocking synchronization, CAS or LL/SC time

dominates

slide-20
SLIDE 20

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-21
SLIDE 21

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-22
SLIDE 22

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-23
SLIDE 23

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-24
SLIDE 24

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-25
SLIDE 25

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-26
SLIDE 26

Avoiding expensive instructions

  • Writer needs locking or non-blocking synchronization
  • What about the reader?
  • Need to ensure that the reader won’t crash
  • Crashes caused by following a bad pointer
  • Assignment to an aligned pointer happens atomically
  • Insert and remove items atomically
  • Need some memory barriers: prevent insertion before

initialization

slide-27
SLIDE 27

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-28
SLIDE 28

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-29
SLIDE 29

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-30
SLIDE 30

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-31
SLIDE 31

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-32
SLIDE 32

Reclamation

  • What about reclamation?
  • Can remove item atomically: reader sees structure with or

without

  • Can’t free item immediately:
  • What if memory reused, reader interprets new data as pointer

to item?

  • Segmentation fault:

core dumped

  • (Best case scenario)
slide-33
SLIDE 33

Deferred reclamation

  • Insertion fine anytime
  • Removal fine anytime, but. . .
  • Can’t reclaim an item out from under a reader
  • Removal prevents new readers
  • How to know current readers stopped using it?
slide-34
SLIDE 34

Deferred reclamation

  • Insertion fine anytime
  • Removal fine anytime, but. . .
  • Can’t reclaim an item out from under a reader
  • Removal prevents new readers
  • How to know current readers stopped using it?
slide-35
SLIDE 35

Deferred reclamation

  • Insertion fine anytime
  • Removal fine anytime, but. . .
  • Can’t reclaim an item out from under a reader
  • Removal prevents new readers
  • How to know current readers stopped using it?
slide-36
SLIDE 36

Deferred reclamation

  • Insertion fine anytime
  • Removal fine anytime, but. . .
  • Can’t reclaim an item out from under a reader
  • Removal prevents new readers
  • How to know current readers stopped using it?
slide-37
SLIDE 37

Deferred reclamation

  • Insertion fine anytime
  • Removal fine anytime, but. . .
  • Can’t reclaim an item out from under a reader
  • Removal prevents new readers
  • How to know current readers stopped using it?
slide-38
SLIDE 38

Deferred reclamation procedure

  • Remove item from structure, making it inaccessible to new

readers

  • Wait for all old readers to finish
  • Free the old item
  • Note: only synchronizes between readers and reclaimers, not

writers

  • Complements other synchronization
slide-39
SLIDE 39

Deferred reclamation procedure

  • Remove item from structure, making it inaccessible to new

readers

  • Wait for all old readers to finish
  • Free the old item
  • Note: only synchronizes between readers and reclaimers, not

writers

  • Complements other synchronization
slide-40
SLIDE 40

Deferred reclamation procedure

  • Remove item from structure, making it inaccessible to new

readers

  • Wait for all old readers to finish
  • Free the old item
  • Note: only synchronizes between readers and reclaimers, not

writers

  • Complements other synchronization
slide-41
SLIDE 41

Deferred reclamation procedure

  • Remove item from structure, making it inaccessible to new

readers

  • Wait for all old readers to finish
  • Free the old item
  • Note: only synchronizes between readers and reclaimers, not

writers

  • Complements other synchronization
slide-42
SLIDE 42

Deferred reclamation procedure

  • Remove item from structure, making it inaccessible to new

readers

  • Wait for all old readers to finish
  • Free the old item
  • Note: only synchronizes between readers and reclaimers, not

writers

  • Complements other synchronization
slide-43
SLIDE 43

Epochs

  • Maintain per-thread and global epochs
  • Reads and writes associated with an epoch
  • When all threads have passed an epoch, free items removed in

previous epochs

  • Reader needs atomic instructions, memory barriers
slide-44
SLIDE 44

Epochs

  • Maintain per-thread and global epochs
  • Reads and writes associated with an epoch
  • When all threads have passed an epoch, free items removed in

previous epochs

  • Reader needs atomic instructions, memory barriers
slide-45
SLIDE 45

Epochs

  • Maintain per-thread and global epochs
  • Reads and writes associated with an epoch
  • When all threads have passed an epoch, free items removed in

previous epochs

  • Reader needs atomic instructions, memory barriers
slide-46
SLIDE 46

Epochs

  • Maintain per-thread and global epochs
  • Reads and writes associated with an epoch
  • When all threads have passed an epoch, free items removed in

previous epochs

  • Reader needs atomic instructions, memory barriers
slide-47
SLIDE 47

Hazard pointers

  • Readers mark items in use with hazard pointers
  • Writers check for removed items in all hazard pointers before

freeing.

  • Reader still needs atomic instructions, memory barriers
slide-48
SLIDE 48

Hazard pointers

  • Readers mark items in use with hazard pointers
  • Writers check for removed items in all hazard pointers before

freeing.

  • Reader still needs atomic instructions, memory barriers
slide-49
SLIDE 49

Hazard pointers

  • Readers mark items in use with hazard pointers
  • Writers check for removed items in all hazard pointers before

freeing.

  • Reader still needs atomic instructions, memory barriers
slide-50
SLIDE 50

Problem: reader efficiency

  • Epochs and hazard pointers have expensive read sides
  • Readers must also write
  • Readers must use atomic instructions
  • Readers must use memory barriers
  • Can we know readers have finished as an external observer?
slide-51
SLIDE 51

Problem: reader efficiency

  • Epochs and hazard pointers have expensive read sides
  • Readers must also write
  • Readers must use atomic instructions
  • Readers must use memory barriers
  • Can we know readers have finished as an external observer?
slide-52
SLIDE 52

Problem: reader efficiency

  • Epochs and hazard pointers have expensive read sides
  • Readers must also write
  • Readers must use atomic instructions
  • Readers must use memory barriers
  • Can we know readers have finished as an external observer?
slide-53
SLIDE 53

Problem: reader efficiency

  • Epochs and hazard pointers have expensive read sides
  • Readers must also write
  • Readers must use atomic instructions
  • Readers must use memory barriers
  • Can we know readers have finished as an external observer?
slide-54
SLIDE 54

Problem: reader efficiency

  • Epochs and hazard pointers have expensive read sides
  • Readers must also write
  • Readers must use atomic instructions
  • Readers must use memory barriers
  • Can we know readers have finished as an external observer?
slide-55
SLIDE 55

Quiescent-state-based reclamation

  • Define quiescent states for threads
  • Threads cannot hold item references in a quiescent state
  • Let “grace periods” contain a quiescent state for every thread
  • Wait for one grace period; every thread passes through a

quiescent state

  • No readers could hold old references, new references can’t see

removed item

slide-56
SLIDE 56

Quiescent-state-based reclamation

  • Define quiescent states for threads
  • Threads cannot hold item references in a quiescent state
  • Let “grace periods” contain a quiescent state for every thread
  • Wait for one grace period; every thread passes through a

quiescent state

  • No readers could hold old references, new references can’t see

removed item

slide-57
SLIDE 57

Quiescent-state-based reclamation

  • Define quiescent states for threads
  • Threads cannot hold item references in a quiescent state
  • Let “grace periods” contain a quiescent state for every thread
  • Wait for one grace period; every thread passes through a

quiescent state

  • No readers could hold old references, new references can’t see

removed item

slide-58
SLIDE 58

Quiescent-state-based reclamation

  • Define quiescent states for threads
  • Threads cannot hold item references in a quiescent state
  • Let “grace periods” contain a quiescent state for every thread
  • Wait for one grace period; every thread passes through a

quiescent state

  • No readers could hold old references, new references can’t see

removed item

slide-59
SLIDE 59

Quiescent-state-based reclamation

  • Define quiescent states for threads
  • Threads cannot hold item references in a quiescent state
  • Let “grace periods” contain a quiescent state for every thread
  • Wait for one grace period; every thread passes through a

quiescent state

  • No readers could hold old references, new references can’t see

removed item

slide-60
SLIDE 60

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-61
SLIDE 61

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-62
SLIDE 62

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-63
SLIDE 63

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-64
SLIDE 64

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-65
SLIDE 65

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-66
SLIDE 66

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-67
SLIDE 67

Read Copy Update (RCU)

  • Read-side critical sections
  • Items don’t disappear inside critical section
  • Quiescent states outside critical section
  • Writers must guarantee reader correctness at every point
  • In theory: copy entire data structure, replace pointer
  • In practice: insert or remove items atomically
  • Writers defer reclamation by waiting for read-side critical

sections

  • Writers may block and reclaim, or register a reclamation

callback

slide-68
SLIDE 68

Classic RCU

  • Read lock: disable preemption
  • Read unlock: enable preemption
  • Quiescent state: context switch
  • Scheduler flags quiescent states
  • Readers perform no expensive operations
slide-69
SLIDE 69

Classic RCU

  • Read lock: disable preemption
  • Read unlock: enable preemption
  • Quiescent state: context switch
  • Scheduler flags quiescent states
  • Readers perform no expensive operations
slide-70
SLIDE 70

Classic RCU

  • Read lock: disable preemption
  • Read unlock: enable preemption
  • Quiescent state: context switch
  • Scheduler flags quiescent states
  • Readers perform no expensive operations
slide-71
SLIDE 71

Classic RCU

  • Read lock: disable preemption
  • Read unlock: enable preemption
  • Quiescent state: context switch
  • Scheduler flags quiescent states
  • Readers perform no expensive operations
slide-72
SLIDE 72

Classic RCU

  • Read lock: disable preemption
  • Read unlock: enable preemption
  • Quiescent state: context switch
  • Scheduler flags quiescent states
  • Readers perform no expensive operations
slide-73
SLIDE 73

Realtime RCU

  • Quiescent states tracked by per-CPU counters
  • read lock, read unlock: manipulate counters
  • Readers perform no expensive operations
  • Allows preemption in critical sections
  • Less efficient than classic RCU
slide-74
SLIDE 74

Realtime RCU

  • Quiescent states tracked by per-CPU counters
  • read lock, read unlock: manipulate counters
  • Readers perform no expensive operations
  • Allows preemption in critical sections
  • Less efficient than classic RCU
slide-75
SLIDE 75

Realtime RCU

  • Quiescent states tracked by per-CPU counters
  • read lock, read unlock: manipulate counters
  • Readers perform no expensive operations
  • Allows preemption in critical sections
  • Less efficient than classic RCU
slide-76
SLIDE 76

Realtime RCU

  • Quiescent states tracked by per-CPU counters
  • read lock, read unlock: manipulate counters
  • Readers perform no expensive operations
  • Allows preemption in critical sections
  • Less efficient than classic RCU
slide-77
SLIDE 77

Realtime RCU

  • Quiescent states tracked by per-CPU counters
  • read lock, read unlock: manipulate counters
  • Readers perform no expensive operations
  • Allows preemption in critical sections
  • Less efficient than classic RCU
slide-78
SLIDE 78

Read-mostly structures

  • RCU ideal for read-mostly structures
  • Permissions
  • Hardware configuration data
  • Routing tables and firewall rules
slide-79
SLIDE 79

Read-mostly structures

  • RCU ideal for read-mostly structures
  • Permissions
  • Hardware configuration data
  • Routing tables and firewall rules
slide-80
SLIDE 80

Read-mostly structures

  • RCU ideal for read-mostly structures
  • Permissions
  • Hardware configuration data
  • Routing tables and firewall rules
slide-81
SLIDE 81

Read-mostly structures

  • RCU ideal for read-mostly structures
  • Permissions
  • Hardware configuration data
  • Routing tables and firewall rules
slide-82
SLIDE 82

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-83
SLIDE 83

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-84
SLIDE 84

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-85
SLIDE 85

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-86
SLIDE 86

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-87
SLIDE 87

Synchronizing between updates

  • RCU doesn’t solve this
  • Need separate synchronization to coordinate updates
  • Can build on non-blocking synchronization or locking
  • Many non-blocking algorithms don’t account for reclamation

at all

  • Can add RCU to avoid memory leaks
  • Reclamation strategry mostly orthogonal from update strategy
slide-88
SLIDE 88

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-89
SLIDE 89

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-90
SLIDE 90

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-91
SLIDE 91

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-92
SLIDE 92

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-93
SLIDE 93

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-94
SLIDE 94

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-95
SLIDE 95

Memory consistency model

  • Handles non-sequentially-consistent memory
  • Minimal memory barriers
  • Does not provide sequential consistency
  • Provides weaker consistency model
  • Readers may see writes in any order
  • Readers cannot see an inconsistent intermediate state
  • Does not provide linearizability
  • Many algorithms do not require these guarantees
slide-96
SLIDE 96

Performance testing

  • Tested RCU and hazard pointers, with locking or NBS
  • All better than locking
  • RCU variants: near-ideal performance
  • Best performer for low write fractions
  • Highly competitive for higher write fractions
slide-97
SLIDE 97

Performance testing

  • Tested RCU and hazard pointers, with locking or NBS
  • All better than locking
  • RCU variants: near-ideal performance
  • Best performer for low write fractions
  • Highly competitive for higher write fractions
slide-98
SLIDE 98

Performance testing

  • Tested RCU and hazard pointers, with locking or NBS
  • All better than locking
  • RCU variants: near-ideal performance
  • Best performer for low write fractions
  • Highly competitive for higher write fractions
slide-99
SLIDE 99

Performance testing

  • Tested RCU and hazard pointers, with locking or NBS
  • All better than locking
  • RCU variants: near-ideal performance
  • Best performer for low write fractions
  • Highly competitive for higher write fractions
slide-100
SLIDE 100

Performance testing

  • Tested RCU and hazard pointers, with locking or NBS
  • All better than locking
  • RCU variants: near-ideal performance
  • Best performer for low write fractions
  • Highly competitive for higher write fractions
slide-101
SLIDE 101

Conclusion

  • RCU implements quiescent-state-based deferred reclamation
  • No expensive overhead for readers
  • Minimally expensive overhead for writers
  • Ideal for read-mostly situations
slide-102
SLIDE 102

Conclusion

  • RCU implements quiescent-state-based deferred reclamation
  • No expensive overhead for readers
  • Minimally expensive overhead for writers
  • Ideal for read-mostly situations
slide-103
SLIDE 103

Conclusion

  • RCU implements quiescent-state-based deferred reclamation
  • No expensive overhead for readers
  • Minimally expensive overhead for writers
  • Ideal for read-mostly situations
slide-104
SLIDE 104

Conclusion

  • RCU implements quiescent-state-based deferred reclamation
  • No expensive overhead for readers
  • Minimally expensive overhead for writers
  • Ideal for read-mostly situations