Resources are objects that your program must explicitly ask for before it can do any work. Multiple resources may be required to perform a logical unit of work. For example, a database area is a resource that you ask for by issuing a READY statement; a database record occurrence is a resource that you ask for by issuing a FIND/OBTAIN statement.
Holding Resources
The number of resources that you hold and the way that you hold them affects other run units. For example, resources can be shared or exclusive.
You should adhere to the following guidelines when holding resources:
Examples of Resources
Typical resources include:
Meaning of Queued Resource
Your site may utilize queued resources. A queued resource is any resource that requires serial access. That is, only one program can access it at a time.
DC allows you to perform the following resource management functions:
These functions are explained below, followed by a list of suggestions that you can use to avoid deadlocks.
Testing for Resource Availability
To determine if a resource or list of resources is currently available, perform the following steps:
Acquiring Resources
To acquire and lock a resource or list of resources, perform the following steps:
Releasing Resources
After all processing is complete, release resources by issuing a DEQUEUE statement. You can release resources by name or all at once (by including the ALL parameter).
Avoiding Deadlock
One of the conditions of deadlock is that a program is holding resources while waiting for other resources. The following list explains techniques that your site can use to minimize this condition:
Note: This protocol will work only if every program in the system follows it.
For example, all update applications that use an area sweep can agree to enter the database starting with the DEPARTMENT record rather than the OFFICE record.
This protocol can also specify the order in which locks will be acquired and released.
Sharing Queued Resources Between CA IDMS Systems
In a data sharing environment, queued resources can be shared between CA IDMS systems that are members of a data sharing group. The benefit of sharing these resources is that access to them can be controlled between programs executing on any member of the group. Whether or not a specific queued resource is shared, is determined by specifications made by the CA IDMS system administrator. Programs accessing queued resources are not sensitive to whether or not a resource is shared, since the DML syntax is the same in either case.
Copyright © 2013 CA.
All rights reserved.
|
|