Edit

Share via


KeSrcuAllocate function (wdm.h)

The KeSrcuAllocate routine allocates and initializes a sleepable Read-Copy-Update (SRCU) partition for synchronization purposes.

Syntax

PKE_SRCU KeSrcuAllocate(
  [in] ULONG Tag
);

Parameters

[in] Tag

A four-character tag value used to identify this SRCU instance.

Return value

KeSrcuAllocate returns a pointer to the allocated SRCU instance on success, or NULL if the allocation fails.

Remarks

KeSrcuAllocate creates a new SRCU synchronization domain that allows multiple readers to access shared data concurrently while ensuring safe updates. SRCU differs from regular RCU in that readers can sleep while holding the read lock.

The SRCU partition returned by this function must be freed using KeSrcuFree when no longer needed.

Each SRCU partition is independent and maintains its own grace periods. SRCU is designed for scenarios where readers may need to sleep or perform blocking operations.

The Tag parameter should be unique to help identify the instance during debugging.

Typical Usage Pattern

Requirements

Requirement Value
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL < DISPATCH_LEVEL

See also

KeSrcuFree

KeSrcuReadLock

KeSrcuReadUnlock

KeSrcuSynchronize