*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> timeout (9r)              
Title
Content
Arch
Section
 

timeout(9r)

Contents


NAME    [Toc]    [Back]

       timeout - General: Initializes a callout queue element

SYNOPSIS    [Toc]    [Back]

       void timeout(
               int (*function) (),
               caddr_t argument,
               register int time );

ARGUMENTS    [Toc]    [Back]

       Specifies  a  pointer to the routine to be called.  Specifies
 a single argument to be passed to the called routine.
       Specifies  the  amount of time to delay before calling the
       specified routine. You express time as time (in seconds) *
       hz.

DESCRIPTION    [Toc]    [Back]

       The timeout routine initializes a callout queue element to
       make it easy to execute the specified routine at the  time
       specified in the time argument. You often use callout routines
 for infrequent polling or error handling.  The  routine
  you  specify  will  be called on the interrupt stack
       (not in processor context) as dispatched  from  the  softclock
 routine.

       The  global variable hz contains the number of clock ticks
       per second. This variable is a  second's  worth  of  clock
       ticks.

       Thus, if you wanted a 4-minute timeout, you would pass 4 *
       60 * hz as the third argument to the  timeout  routine  as
       follows:

        /* A 4-minute timeout */
        .
        .
        .
        timeout(lptout, (caddr_t)dev, 4 * 60 * hz);

NOTES    [Toc]    [Back]

       The  granularity  of  the  time  delay is dependent on the
       hardware. For example, the granularity of some Alpha  CPUs
       is  1024  clock ticks per second.  Other Alpha CPUs have a
       granularity of 1200 clock ticks per  second.  Still  other
       Alpha  CPUs  exhibit  a granularity of 128 clock ticks per
       second.  Because the granularity  of  the  time  delay  is
       dependent  on  the hardware, the operating system provides
       the hz and lbolt global variables. Use the hz global variable
 to determine the number of clock ticks per second for
       a specific Alpha CPU. Use the lbolt global variable  as  a
       periodic wakeup mechanism.

RETURN VALUES    [Toc]    [Back]

       None







SEE ALSO    [Toc]    [Back]

      
      
       Routines: untimeout(9r)



                                                      timeout(9r)
[ Back ]
 Similar pages
Name OS Title
queue_init Tru64 General: Initializes the specified queue
remque Tru64 General: Add or remove an element from the queue
insque Tru64 General: Add or remove an element from the queue
untimeout Tru64 General: Removes the scheduled routine from the callout queues
rminit Tru64 General: Initializes a resource map
insque NetBSD insert/remove element from a queue
remque NetBSD insert/remove element from a queue
remque Tru64 Insert or removes an element in a queue
insque OpenBSD insert/remove element from a queue
remque OpenBSD insert/remove element from a queue
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service