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

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

mpsleep(9r)

Contents


NAME    [Toc]    [Back]

       mpsleep - General: Blocks the current kernel thread

SYNOPSIS    [Toc]    [Back]

       int mpsleep(
               caddr_t channel,
               long pri,
               char *wmesg,
               long timo,
               void *lockp,
               long flags );

ARGUMENTS    [Toc]    [Back]

       Specifies  an  address  associated with the calling kernel
       thread to be blocked.  Can specify the  following  values:
       When  set,  specifies that the sleep request is interruptible.
  That is, the kernel thread  can  take  asynchronous
       signals. Not setting the PCATCH flag causes the process to
       sleep in an uninterruptible state.   When  set,  specifies
       that  the  process  can  be asynchronously suspended while
       waiting.

              On the operating system you cannot use pri  to  set
              the  scheduling  priority  of  the calling process.
              Specifies a mnemonic for the type of wait.  The  ps
              command  uses  this  mnemonic in its messages about
              the process.  Specifies the maximum amount of  time
              the  kernel thread should block.  The kernel thread
              blocks a maximum of timo divided by hz seconds.  If
              you  pass the value 0 (zero), mpsleep assumes there
              is no timeout.   Specifies  a  pointer  to  a  lock
              structure  that  you want to unlock before the process
 sleeps. If you do not want to release a  lock,
              pass  the  value 0 (zero).  Specifies the lock type
              of the lockp argument and how to  handle  the  lock
              after blocking.

              You  can  specify  one  of the following valid lock
              types, defined in the <param.h> file: Calls mpsleep
              with  a simple lock asserted.  Calls mpsleep with a
              read-only lock asserted on  entry.   Calls  mpsleep
              with a write lock asserted.

              In  addition,  you can specify one of the following
              ways to handle  the  lock  after  blocking:  Forces
              mpsleep  to  relock  the  lock  on failure.  Forces
              mpsleep not to relock after blocking.

DESCRIPTION    [Toc]    [Back]

       The mpsleep routine blocks (puts  to  sleep)  the  current
       kernel  thread until a wakeup is issued on the address you
       specify in the channel argument. This routine is the  symmetric
  multiprocessor (SMP) sleep call. The kernel thread
       blocks a maximum of timo divided by hz seconds. The value0
       (zero) means there is no timeout.

       If you pass the PCATCH flag to the pri argument, the sleep
       request is interruptible, and the kernel thread  can  take
       asynchronous signals. If you pass the PSUSP flag, the process
 can be asynchronously suspended while waiting.

       The mpsleep routine allows you to specify a pointer  to  a
       simple  or  complex lock structure that is associated with
       some resource.  If the MS_LOCK_NO_RELOCK flag is  set,  it
       does   not   relock   the  lock  after  blocking.  If  the
       MS_LOCK_ON_ERROR flag is set (or no flag is set),  mpsleep
       relocks the lock on failure.

NOTES    [Toc]    [Back]

       This  routine  is  not  intended  for  general use.  It is
       mostly used by  sleep  and  tsleep  and  by  knowledgeable
       callers.

       The mpsleep routine cannot be called from within an Interrupt
 Service routine (ISI) because it is illegal to  block
       at interrupt context.

RETURN VALUES    [Toc]    [Back]

       The mpsleep routine returns the following values: Successful
 completion.  The sleep has been interrupted by a  signal.
   The  sleep  has  been  interrupted by a signal on a
       restartable system call.  The timeout has expired.

SEE ALSO    [Toc]    [Back]

      
      
       Routines:      assert_wait_mesg(9r),       clear_wait(9r),
       thread_block(9r), thread_wakeup(9r), thread_wakeup_one(9r)



                                                      mpsleep(9r)
[ Back ]
 Similar pages
Name OS Title
thread_block Tru64 General: Blocks (puts to sleep) the current kernel thread
select_enqueue Tru64 General: Adds the current kernel thread
thread_set_timeout Tru64 General: Sets a timer for the current kernel thread
assert_wait_mesg Tru64 General: Asserts that the current kernel thread is about to block (sleep)
select_wakeup Tru64 General: Wakes up a kernel thread
current_thread Tru64 General: Is a pointer to the currently running kernel thread
unix_release Tru64 General: Releases binding of the kernel thread
thread_wakeup_one Tru64 General: Wakes up the first kernel thread waiting on a channel
select_dequeue Tru64 General: Removes the last kernel thread waiting for an event
thread_terminate Tru64 General: Prepares to stop or stops execution of the specified kernel thread
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service