DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
HDK Technical Reference

Delays and busy-waits

Delays and busy-waits are synchronization primitives used to stop execution for a specified period of time.

Often, driver-hardware interaction will require the driver to busy-wait for a very short time so the hardware device can complete a transition to a sane state. This particular busy-wait requirement is especially necessary when interrupts are not available to notify drivers of device state transitions, typically during the driver's init(D2) and halt(D2) entry point routines.

Delays and busy waits can degrade system performance, especially on multiprocessor configurations. In most cases, it is better for the driver to block and release processor control than to use these functions. Timeouts may also be an alternative; see ``Timeouts''.

DDI implementation

The following functions are provided for DDI drivers:


delay(D3)
delay execution for specified time. This is an alternative to the timeout functions when the driver needs to block for a specified time rather than while waiting for a certain event.

drv_usecwait(D3)
busy-wait for specified time.

drv_usectohz(D3)
convert microseconds to clock ticks.

drv_hztousec(D3)
convert clock ticks to microseconds.

ODDI implementation

The following functions are provided for ODDI drivers:


delay(D3oddi)
delay exectution for the specified number of clock ticks.

suspend(D3oddi)
suspend exectution for the specified number of microseconds.

© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005