KeSrcuSynchronize - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

VOID KeSrcuSynchronize(
  [in] PKE_SRCU Rcu
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-kesrcusynchronize)

Description

The KeSrcuSynchronize routine waits until all currently active read-side critical sections for a Sleepable Read-Copy-Update (SRCU) partition have exited.

Parameters

Rcu [in]

A pointer to the SRCU instance that was previously allocated by KeSrcuAllocate.

Remarks

KeSrcuSynchronize implements the "synchronize" operation for SRCU, which starts a grace period and waits for all currently active readers to exit their critical sections. This function is essential for safe memory reclamation and data structure updates.

The grace period semantics are as follows:

Call this function only at IRQL < DISPATCH_LEVEL since it may block. This function can sleep, making it suitable for pageable code. Don't call this function from within an SRCU read-side critical section.

The typical writer pattern is as follows:

  1. Remove data structure from global visibility.
  2. Call KeSrcuSynchronize to wait for existing readers.
  3. Safely deallocate or modify the data structure.

The function ensures that no readers are accessing the data when it returns, making it safe to perform updates or memory reclamation.

See also

KeSrcuAllocate

KeSrcuFree

KeSrcuReadLock

KeSrcuReadUnlock