Semaphores are global signal flags in the system that set up mutually exclusive (mutex) resources. Use them to make some processes wait for other processes to finish.
Use
to view job semaphores that are in use. You can also clear semaphores, which may be necessary when a hung or cancelled job fails to release its semaphore.For example, suppose you have a program that creates a printer driver, and you want the program to be used by only one process at any one time. Within each project that calls the program, set up three steps with the following command lines:
Step |
Command Line |
---|---|
Get semaphore |
.semget $BF_PROJECTNAME_PHYS |
Execute driver creator |
printdrivermaker.exe windows |
Release semaphore |
.semput $BF_PROJECTNAME_PHYS |
You can establish semaphores for key resources in your organization, such as a heavily loaded server or a software program with a single-user license. Every step that uses the resource you want to protect should be wrapped with .semget and .semput commands.
Semaphores obey the following rules: