// wdm.h
VOID KeRcuReadLock();
View the official Windows Driver Kit DDI referenceNo description available.
The KeRcuReadLock function enters a RCU (Read-Copy-Update) read-side critical section in the default RCU domain. This function pins the calling thread to its current processor and prevents it from being preempted by the scheduler.
KeRcuReadLock provides low-cost synchronization for reading shared data structures without traditional locking overhead. It only accesses data local to the current CPU, making it extremely efficient.
RCU read-side critical sections allow multiple threads to concurrently access shared data structures while ensuring that writers can safely update the data using RCU protocols. RCU read-side critical sections can be nested.
KeRcuReadLock must always be paired with a corresponding call to KeRcuReadUnlock.
This function cannot fail and always succeeds.
Within a RCU read-side critical section:
This function can be called from any IRQL. If it's called below DISPATCH_LEVEL, the function automatically raises IRQL to DISPATCH_LEVEL. The original IRQL is restored when the corresponding KeRcuReadUnlock is called
The calling thread is pinned to its current processor to maintain RCU semantics. If the processor is marked as idle, the function adjusts the idle state counters appropriately. The scheduler is prevented from preempting the thread while in the critical section.
The function uses the default RCU domain, making it suitable for simple RCU use cases. For more complex scenarios requiring custom synchronization domains, use KeSrcuReadLock with an explicit SRCU partition.