DescriptionThe Semaphore object provides a mechanism for one process to sleep until another awakens it. An actor (a process) that wishes to delay until a provider (another process) has completed some operation invokes the semaphore object. When the provider has completed it's operation, it invokes the semaphore to awaken the actor. A sempahore is in some sense the inverse of a mutex object. Where a mutex object ensures that only a single process can run, a semaphore ensures that only a single process is blocked. Note that an invoker can wake up a previous invoker without sleeping by performing a fork rather than a call of the semaphore key. Operations
Copyright 1998 by Jonathan Shapiro. All rights reserved. For terms of redistribution, see the GNU General Public License |