DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

delay(D3)


delay -- delay process execution for a specified number of clock ticks

Synopsis

   void delay(long ticks);

Description

delay causes the caller to sleep for the amount of time specified by ticks, which is in units of clock ticks. The exact length of the delay is not guaranteed but it will not be less than ticks -1 clock ticks.

Arguments


ticks
The number of clock ticks to delay.

Return values

None

Usage

The length of a clock tick can vary across different implementations and therefore drivers should not include any hard-coded assumptions about the length of a tick. The drv_usectohz(D3) and drv_hztousec(D3) functions can be used, as necessary, to convert between clock ticks and microseconds (implementation independent units).

The delay function calls timeout(D3) [or, for multithreaded drivers, itimeout(D3)] to schedule a wakeup after the specified amount of time has elapsed. delay then goes to sleep until timeout (or itimeout) wakes up the sleeping process.

Context and synchronization

User or blockable context.

Calling this function while a driver-defined sleep lock is held can adversely affect performance by forcing any other processes that are contending for the lock to block for the duration of the delay.

Hardware applicability

All

Version applicability

ddi: 1, 2, 3, 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

SCO OpenServer ODDI compatibility

delay(D3oddi) is the ODDI equivalent of this function.

References

drv_hztousec(D3), drv_usectohz(D3), drv_usecwait(D3), itimeout(D3), sleep(D3), timeout(D3), untimeout(D3), wakeup(D3)

``Delays and busy-waits'' in HDK Technical Reference


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