SVR5
wakeup(D3)
wakeup --
resume suspended process execution
Synopsis (Not in current DDI version)
#include <sys/types.h>
#include <sys/ddi.h>
void wakeup(caddr_t event);
Description
wakeup awakens all processes sleeping on the address specified
by event and makes them eligible for scheduling.
Arguments
event-
Address that was passed to the corresponding call to
sleep(D3)
which caused the process to be suspended.
Return values
None
Usage
The same event argument must be used for corresponding calls to
sleep and wakeup.
It is recommended
for code readability and for efficiency to have a one-to-one
correspondence between events and sleep addresses.
Whenever a driver returns from a call to sleep, it should test to ensure
that the event for which the driver slept actually occurred.
There is an interval between the time the process that called sleep is
awakened and the time it resumes execution where the state forcing the
sleep may have been reentered.
This can occur because all processes waiting for an event
are awakened at the same time.
The first process selected for execution by the scheduler
usually gains control of the event.
All other processes awakened should recognize that they cannot
continue and should reissue the sleep call.
Context and synchronization
Non-blockable, interrupt, user, or blockable
context.
Hardware applicability
All
Version applicability
ddi:
1, 2, 3, 4, 5, 5mp, 6, 6mp
Differences between versions
Starting with DDI version 7,
SV_BROADCAST(D3)
and
SV_SIGNAL(D3)
replace
wakeup( ).
These new functions are much faster,
since they avoid the hash table insertion and lookup
that are needed to unblock the process
based on an arbitrary channel number.
Instead, they are passed a driver-owned sv-t object
which directly tracks sleeping LWPs.
See
``Synchronization variables'' in HDK Technical Reference.
Under some conditions, even greater performance
can be achieved by using
SV_SIGNAL( ),
which only wakes up one LWP,
rather than waking up all the sleeping LWPs
and then having all but one
go back to sleep again.
SV_SIGNAL( )
must, however, be used with care.
References
sleep(D3)
``Synchronization variables'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005