Read-copy-update
Sign in to saveAlso known as RCU
In computer science, read-copy-update (RCU) is a synchronization mechanism that avoids the use of lock primitives while multiple threads concurrently read and update elements that are linked through pointers and that belong to shared data structures (e.g., linked lists, trees, hash tables).
~24 min read
Article
13 sectionsContents
- Name and overview
- Detailed description
- Uses
- Advantages and disadvantages
- Patents
- Sample RCU interface
- Simple implementation
- Analogy with reader–writer locking
- History
- See also
- Notes
- References
- External links
In computer science, read-copy-update (RCU) is a synchronization mechanism that avoids the use of lock primitives while multiple threads concurrently read and update elements that are linked through pointers and that belong to shared data structures (e.g., linked lists, trees, hash tables).
Whenever a thread is inserting or deleting elements of data structures in shared memory, all readers are guaranteed to see and traverse either the older or the new structure, therefore avoiding inconsistencies (e.g., dereferencing null pointers).