RCU: Reader-Writer Locking and Garbage Collection for Parallel Processing, Study notes of Computer Science

An outline for understanding reader-writer locking (rwl) and read copy update (rcu) synchronization techniques. Rcu allows multiple readers to access data concurrently with a single writer, while ensuring data consistency through garbage collection and linearization points. The document also discusses the concept of relativistic programming and its relation to rcu.

Typology: Study notes

Pre 2010

Uploaded on 08/19/2009

koofers-user-5ho
koofers-user-5ho 🇺🇸

10 documents

1 / 26

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Outline
Intro – Phil
Modern Processors – why – Jim
RCU – what – Phil
Hash Tables – how - Josh
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download RCU: Reader-Writer Locking and Garbage Collection for Parallel Processing and more Study notes Computer Science in PDF only on Docsity!

Outline

  • Intro – Phil• Modern Processors – why – Jim • RCU – what – Phil • Hash Tables – how - Josh

Synchronization

Read Copy Update (RCU)

A

B

C

D

C’

RCU – What does this buy us? • Readers need

NO^

synchronization

  • Single writer in parallel with readers

Need for Garbage Collection

A

B

C

D

C’

RCU – What does this cost us? • Need for garbage collection• Potential for “stale data”

RCU Garbage Collection

Linux Style

  • RCU is part of a system call• system calls don’t save state betweencalls• Grace Periods can be defined in terms ofcontext switches^ – no pre-emption– every processor goes through a contextswitch • No need to keep track of individualprocesses/threads

Read-side APIs RWL

-^ read_lock()



-^ read_unlock()



RCU

-^ rcu_read_lock()

-^ rcu_dereference()

-^ rcu_read_unlock()

Linearization Points

  • A single point in time where an actiontakes effect• Correctness Criteria• Allows actions to be treated as atomic

Write-side Linearization Points

RWL

-^ write_lock()



-^ write_unlock()



RCU

-^ lock()

-^ rcu_assign_pointer()

-^ synchronize_rcu()

-^ free()

-^ unlock()

Which dereference?^ A

B

C

D

C’

RWL Stale Data

request_read_lock()acquire_read_lock()

computationinternal actionread_unlock()

external_action

RWL Stale Data

request_read_lock()acquire_read_lock()

request_write_lock()

acquire_write_lock()

update_data

computation

write_unlock()

internal actionread_unlock()

external_action

RCU Stale data

rcu_read_lock()rcu_dereference()

computationinternal actionrcu_read_unlock()

external_action