NET/MASTER Network Control Language (NCL) Programmer's Guide

Synchronizing Access to Resources
Advanced NCL Programming
18–20 106160 Tandem Computers Incorporated
Minor Names
The minor name of a resource, if required, is a character string from 1 through 250
characters long which qualifies the resource’s primary name to identify a specific
resource within a resource group.
For example, the following primary name represents both a resource group and a
specific resource:
DOG
The following resources represent specific resources within the DOG resource group:
DOG.SPANIEL
DOG.TERRIER
The Resource Name
Hierarchy
Specific resource names, that is, those that are explicitly defined by primary and minor
names, are peers within their resource group.
Any NCL process that obtains exclusive control of the resource DOG prevents any
other NCL process from gaining access to any of the other resource below DOG in the
hierarchy. No NCL process is able to gain access to the DOG.SPANIEL resource lock
until the NCL process that controls DOG releases its exclusive control of the DOG
resource lock.
Alternatively, an NCL process that requests exclusive control of the DOG.SPANIEL
resource does not interfere with any other NCL process that needs to access the
DOG.TERRIER resource.
Resource Naming
Conventions
Resources are only names. They are not real entities. Accordingly, to be effective, the
NCL processes that use locks must agree to use the same resource names and must
agree that a resource name means the same thing to all NCL processes.
Once the resource names are established, all NCL processes must use the LOCK verb
to obtain the resource locks whenever resources are to be accessed, otherwise no
protection to data can be guaranteed.
It is very important that you define a naming convention for resource identification.
Ideally your naming convention should apply to all NonStop NET/MASTER MS
systems within your organization. Alternatively, naming conventions can apply
within a given NonStop NET/MASTER MS system, or within a specific set of NCL
procedures.
Controlling Access The LOCK verb controls access to resources. The scope of the LOCK verb is
system-wide—it is not restricted to your NCL region alone. The LOCK verb is used to
designate a particular resource lock that an NCL process wants to control and specifies
the type of control that is required.
If the NCL process requires exclusive control of the resource lock, all other NCL
processes in the system are prevented from gaining access to the resource at the same
time. Alternatively, the NCL process may want to gain shared access to the resource
lock. This prevents any other procedure from being granted exclusive access.