Novell Semaphores

Prev Next Home Home Table Of Contents Index

NOVELL SEMAPHORES

For a detailed explanation of Novell Semaphores, read the Novell manuals. What we've done is to export these functions to MarxMenu. We have implemented them slightly different than Novell did and have hidden all the nasties from you such as semaphore handles. All semaphores are accessed by name only.

Here's a brief overview of semaphores. Semaphores are names of shared resources that the server keeps track of. Semaphores have three properties. They have a name, value and number of users. The name can be anything up to 48 characters long. The value is a number from -128 to 127. If the value is less than 0, the resource the semaphore represents is considered used up.

By opening a semaphore, you increase the number of users by one. By closing it, you decrease the number by one. If a single user opens a semaphore many times, it is only counted as one. When you log out, your semaphores are closed. This is also true if you turn your computer off, but it takes 15 minutes for the server to give up on you.

The first user to open a semaphore creates it. The last user to close a semaphore deletes it. When a semaphore is created, a value can be assigned. If a semaphore is opened that already exists, the initial value is ignored.

When NovWaitOnSemaphore is called by any user, the value is decremented. If the value is not below zero, NovWaitOnSemaphore returns true. Otherwise it returns false and the value is unchanged. The amount of time that NovWaitOnSemaphore will wait is controlled by the variable NovSemaphoreTimeOut.

When NovSignalSemaphore is called by any user, the value is incremented. This allows other users to call NovWaitOnSemaphore and get a True value.

NovSemaphoreUsers and NovSemaphoreValue are used to read the status of a semaphore without changing it's value.

One of the major differences between how MarxMenu uses semaphores and the way Novell uses them is that normally a semaphore dies when the application finishes. This would normally prevent a zero k menu system from being able to use them. MarxMenu uses an interesting trick where it fools Netware into thinking that the semaphore belongs to a TSR in memory. This allows the semaphore to live.

Semaphores can be used for software metering. I've changed the semaphores to work with TSRs in upper memory. You no longer need a TSR in low memory for semaphores to live. This improves software metering.

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home