Current Version 2.5
zip
tar gzip
Author: Evan Rempel erempel@UVic.CA
This package implements a straight forward semaphore signal and wait mechanism. Semaphores can go up or down the interpreter hierarchy. Names within the same interpreter may not contain a "/" character. To specify a semaphore in a child interpreter, use a semaphore name of the form child/name which may be recursive. To specify a semaphore of a parent interpreter, use a semaphore name of the form ../name which may be recursive.
::Semaphore::Signal name
Signalling a semaphore may release one of the pending ::Semaphore::Wait or incrementing its counter so that a successive ::Semaphore::Wait will not block.
Semaphore names in a child interpreter take on the name of {interpreter name}/{semaphore name} in the parent interpreter. Children can use the name ../{semaphore name} to signal parent semaphore. Siblings may signal each other by using semaphores in the parent interpreter.
::Semaphore::Wait {glob name} ...
The semaphore names are checked in the order that they are specified allowing you to create an effective priority for waiting on semaphores.
Semaphore names in a child interpreter take on the name of {interpreter name}/{semaphore name} in the parent interpreter. Children can use the name ../{semaphore name} to signal parent semaphore. Siblings may signal each other by using semaphores in the parent interpreter.
::Semaphore::Reset name
::Semaphore::Status name
::Semaphore::Extend interpreter
Although the Extend can only extend to an immediate child, the signal, wait and status routines are not restricted in this way. You can use ../../signalName and interp/interp/signalName or further nestings if you desire.
This construct allows code to be written that signals semaphores within its own interpreter without the knowledge that it is running in a child interpreter, even though a parent interpreter is waiting on child/signalName without any worry of signal name conflicts with other packages.