Share via


NdisGetCurrentProcessorCpuUsage (Compact 7)

3/12/2014

This function returns how busy the current processor is as a percentage.

Syntax

VOID
  NdisGetCurrentProcessorCpuUsage(
    PULONG  pCpuUsage
    );

Parameters

  • pCpuUsage
    A pointer to a caller-supplied variable in which this function returns the percentage of CPU, on which the caller is running, that is currently being used.

Return Value

None

Remarks

NDIS drivers can call NdisGetCurrentProcessorCpuUsage to determine how loaded the CPU on which they are running is so that they can change how they handle certain operations to improve driver performance.

For example, a miniport driver might call this function periodically and, as its percentage of CPU usage trends higher, disable interrupts on a network adapter and switch to polling the state of the network adapter. This strategy yields higher performance during periods of high network traffic by eliminating interrupt-processing overhead while the network adapter is generating many interrupts. Instead of using interrupts, the driver's NetTimerCallback function can poll the network adapter and make receive indications and complete send requests until network traffic declines again. When its periodic calls to NdisGetCurrentProcessorCpuUsage indicate CPU usage is trending lower again, such a driver would re-enable interrupts on the network adapter and cancel its timer.

Requirements

Header

ndis.h

See Also

Reference

NDIS Current Information Functions
NetTimerCallback