NdisStallExecution

VOID
NdisStallExecution(

IN UINT MicrosecondsToStall
);

NdisStallExecution stalls the caller on the current processor for a given interval.

Parameters

MicrosecondsToStall

Specifies the number of microseconds to delay.

Comments

For the given MicrosecondsToStall, the caller's thread of execution stalls on the current processor, consuming CPU cycles. When the given interval expires, the caller resumes execution.

Unless a driver is running at IRQL >= DISPATCH_LEVEL, it should call NdisMSleep, which accepts larger delay intervals without monopolizing a processor for its callers, instead of NdisStallExecution. For example, a NIC driver's MiniportInitialize function should wait for state changes in the NIC with NdisMSleep.

Both NdisMSleep and NdisStallExecution allow a NIC driver to specify a delay consistently and independently of the clock speed of the host CPU. Neither function involves a timer object used by NdisSet(Periodic)Timer. The resolution of the host system clock varies, so very short delays can take slightly longer than the caller of NdisMSleep or NdisStallExecution specified.

A call to NdisStallExecution prevents any other operating system activity on the current processor and prevents system interrupts from occurring during the stall. Therefore, callers should always specify a stall interval of no longer than 50 microseconds.

Callers of NdisStallExecution can run at any IRQL.

See Also

MiniportInitialize, MiniportReset, NdisMSleep, NdisSetTimer