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

  man pages->FreeBSD man pages -> sleepinit (9)              
Title
Content
Arch
Section
 

SLEEPQUEUE(9)

Contents


NAME    [Toc]    [Back]

     endtsleep, sleepinit, unsleep -- manage the queues of sleeping processes

SYNOPSIS    [Toc]    [Back]

     #include <sys/param.h>
     #include <sys/proc.h>

     void
     endtsleep(void *arg);

     void
     sleepinit(void);

     void
     unsleep(struct thread *td);

DESCRIPTION    [Toc]    [Back]

     The sleep queues used by msleep(9) and friends are stored in a hash
     array.  The address of the wait channel is used to generate an index into
     the array.  Each entry in the array is a queue of processes that are
     sleeping on wait channels that hash to that index.  msleep(9) places processes
 into their appropriate queues directly.  To handle timeouts, the
     endtsleep() function is registered as a timeout(9).  When the process is
     woken by either wakeup() or wakeup_one(), the timeout is revoked via
     untimeout(9).  If the process is not awakened soon enough, then
     endtsleep() is called with arg pointing to the struct proc of the process
     that timed out.  endtsleep() undoes the sleep and makes the process
     runnable if it is in the SSLEEP state.  The sleep queues and the hash
     array are protected internally by the sched_lock mutex.

     unsleep() simply removes the thread td from its sleep queue.

     sleepinit() is called during system startup and initializes the scheduler
     quantum (sched_quantum) and the sleep queues.

SEE ALSO    [Toc]    [Back]

      
      
     msleep(9), runqueue(9), scheduler(9)


FreeBSD 5.2.1		       November 3, 2000 		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
wakeup Tru64 General: Wakes up all processes sleeping on a specified address
chooseproc FreeBSD manage the queue of runnable processes
detachpids IRIX manage child processes in background
runqueue FreeBSD manage the queue of runnable processes
setrunqueue FreeBSD manage the queue of runnable processes
remrunqueue FreeBSD manage the queue of runnable processes
procrunnable FreeBSD manage the queue of runnable processes
CIRCLEQ_INIT NetBSD implementations of singlylinked lists, lists, simple queues, tail queues, and circular queues
CIRCLEQ_HEAD_INITIALIZER NetBSD implementations of singlylinked lists, lists, simple queues, tail queues, and circular queues
CIRCLEQ_HEAD NetBSD implementations of singlylinked lists, lists, simple queues, tail queues, and circular queues
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service