1 Userspace RCU Implementatation
2 by Mathieu Desnoyers and Paul E. McKenney
16 Each thread that has reader critical sections (that uses
17 rcu_read_lock()/rcu_read_unlock() must first register to the URCU
18 library. This is done by calling rcu_register_thread().
22 Reader critical sections must be protected by locating them between
23 calls to rcu_read_lock() and rcu_read_unlock(). Inside that lock,
24 rcu_dereference() may be called to read an RCU protected pointer.
28 rcu_assign_pointer() and rcu_xchg_pointer() may be called anywhere.
29 After, synchronize_rcu() must be called. When it returns, the old
30 values are not in usage anymore.
32 Being careful with signals
34 The library uses signals internally. The signal handler is
35 registered with the SA_RESTART flag. However, these signals may cause
36 some non-restartable system calls to fail with errno = EINTR. Care
37 should be taken to restart system calls manually if they fail with this
38 error. A list of non-restartable system calls may be found in
39 signal(7). To ensure the Userspace RCU library does not use signals,
40 define CONFIG_URCU_AVOID_SIGNALS at compile-time.
42 Usage of CONFIG_URCU_AVOID_SIGNALS
44 CONFIG_URCU_AVOID_SIGNALS uses full SMP barriers for readers. This
45 eliminates the need for signals but results in slower reads.
50 DEBUG_YIELD is used to add random delays in the code for testing