Using Semaphores for Software Metering

Prev Next Home Home Table Of Contents Index

USING SEMAPHORES FOR SOFTWARE METERING

An example of menu code that uses semaphores for software metering can be found in the file METER.INC. This metering ability is limited to Novell networks only.

This software metering module counts how many users are using an application and limits it to a fixed number of users. Thus, you can save money on other software by limiting the number of people who can run an application to the number of copies you own.

This can also be used to limit an application to 1 user where the application only works on a network for one user at a time.

To use this module, add the line INCLUDE 'METER.INC' to your menu. Then under the OnKey you want to meter:


 OnKey 'W'
    |if Limit('WP',6) then Return   ;limit to 6 users
    WP

In the above example, a Word Perfect choice is limited to 6 users. Thus you may have 20 users total but only 6 can run Word Perfect at the same time.

The way it works is, MarxMenu creates a semaphore when it runs an application and stores the semaphore name in an environment variable named METER. When the user returns to the menu the semaphore is cleared. If the user turns off their computer in the middle of an application, Netware will clear the semaphore within 15 minutes.

USAGE LOGGING:


 OnKey 'W'
    |LogIt('WordPerfect')
    WP

This will send a log line to the log file that is a comma delimited ASCII line with fields as follows:


 "UserName","Program","Start Time","End Time"

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home