Digital UNIX has a two-step approach like Linux although,
unsurprisingly, it's more complex partly because it provides a
mixture of Mach-ish and BSD-ish APIs. Unlike Linux, though, it
does keep a hash of wait queues. The two steps are
assert_wait(event, interruptible);
...
thread_block();
The assert_wait() says the thread is about to block and puts it on
the wait queue. thread_block() is the equivalent of Linux
schedule(). I suppose in some ways assert_wait() (in its simplest
guise) is more like
current->state = TASK_INTERRUPTIBLE;
On top of that, though, Digital UNIX then has a whole host of
additions: there are plenty of macros around the basic primitives
which let you do things like pass in a simple or complex lock to be
locked/unlocked where necessary, you can specify timeouts, you can
send a result along with a wakeup to say why you woke the target up
(thread_wakeup_with_result), you can do thread_wakeup to wakeup all
threads or thread_wakeup_one to wake one, you can even clear the
wait condition of another thread explicitly (plus all this has to
cope with swapped out task structures). There are macros to support
the BSDish API with tsleep, mpsleep as well as the Machish ones.
In brief, the two-step assert/block is like Linux but the complex
additional APIs certainly isn't.
--Malcolm
-- Malcolm Beattie <mbeattie@sable.ox.ac.uk> Unix Systems Programmer Oxford University Computing Services- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/