Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wakeup(9r) [osf1 man page]

wakeup(9r)																wakeup(9r)

NAME
wakeup - General: Wakes up all processes sleeping on a specified address SYNOPSIS
void wakeup( caddr_t channel ); ARGUMENTS
Specifies the address on which the wakeup is to be issued. DESCRIPTION
The wakeup routine wakes up all processes sleeping on the address specified by the channel argument. All processes sleeping on this address are awakened and made ready to be scheduled according to the priorities they specified when they went to sleep. It is possible that there are no processes sleeping on the channel at the time the wakeup is issued. This situation can occur for a variety of reasons and does not represent an error condition. The sleep and wakeup routines block and unblock a process. Generally, a device driver issues these routines on behalf of a process request- ing I/O while a transfer is in progress. That is, a process requesting I/O is put to sleep on an address associated with the request by the appropriate device driver routine. When the transfer has asynchronously completed, the device driver interrupt service routine issues a wakeup on the address associated with the completed request. This action makes the relevant process to be scheduled. The process resumes execution within the relevant device driver routine at the point immediately following the request to sleep. The driver, on behalf of the process, can then determine whether the condition for which it was sleeping (in this example, completion of an I/O request) has been removed. If so, it can continue on to complete the I/O request. Otherwise, the appropriate driver routine can decide to put the process back to sleep to await removal of the indicated condition. RETURN VALUES
None SEE ALSO
Routines: mpsleep(9r), sleep(9r) wakeup(9r)

Check Out this Related Man Page

sleep(9r)																 sleep(9r)

NAME
sleep - General: Puts a calling process to sleep SYNOPSIS
void sleep( caddr_t *channel, long pri ); ARGUMENTS
Specifies a unique address associated with the calling kernel thread to be put to sleep. Specifies whether the sleep request is interrupt- ible. Setting this argument to the PCATCH flag causes the process to sleep in an interruptible state (that is, the kernel thread can take asynchronous signals). Not setting the PCATCH flag causes the process to sleep in an uninterruptible state (that is, the kernel thread can- not take asynchronous signals). DESCRIPTION
The sleep routine puts a calling process to sleep on the address specified by the channel argument. Some common addresses are the lbolt argument, a buf structure, and a proc structure. This address should be unique to prevent unexpected wake/sleep cycles, which can occur if different processes are sleeping on the same address accidentally. If you set the PCATCH flag in the pri argument, the sleep routine puts signals on the queue and does not wake up the sleeping process. The sleep and wakeup routines block and then wake up a process. Generally, device drivers call these routines to wait for the transfer to complete an interrupt from the device. That is, the write routine of the device driver sleeps on the address of a known location, and the device's Interrupt Service Interface (ISI) wakes the process when the device interrupts. It is the responsibility of the wakened process to check if the condition for which it was sleeping has been removed. NOTES
The operating system provides two ways to put a process to sleep: interruptible and uninterruptible. The sleep routine performs an uninter- ruptible sleep operation if you do not set the PCATCH flag and an interruptible sleep operation if you set the PCATCH flag. This means that device drivers cannot call sleep at interrupt context because at interrupt context there is no calling process to be put to sleep. Thus, a device driver's Interrupt Service Interface (ISI) and those routines called from within the ISI must not call the sleep routine. On this operating system, you cannot use pri to set the scheduling priority of the calling process. RETURN VALUES
None FILES
SEE ALSO
Routines: wakeup(9r) sleep(9r)
Man Page