Restrictions on Circular Linkage and Circular Provision

Requirements for Circular Linkage

If the system determines that a particular linkage attempt would complete a circular linkage, then the system imposes the following restrictions on that linkage attempt:

  • A circular linkage can be made only if all the libraries involved are either frozen server libraries or ready connection libraries, and at least one of them was already frozen or ready at the time it linked to one of the other libraries in the circle.

  • No more than one of the libraries in a circular linkage can have a freeze type of CONTROL.

  • A given object exported by a library cannot be provided circularly by the same object in the same library. That is, if library L exports procedure X, the chain of linkages that provide that procedure cannot lead back to procedure X in library L. However, the linkages could lead back to some other procedure, for example Y, in library L.

For an example of libraries that violate this restriction, refer to “Example 1: Indirect Self Referencing,” under ALGOL Incorrect Circular Libraries.

Error for Incorrect Linkages

If the client process makes a procedure call that results in a circular linkage of two or more libraries that violates one of these restrictions, the system discontinues the client process and displays the error message “CURRENT CIRCULAR LIBRARY REFERENCE STRUCTURE IS NOT ALLOWED: <library name>.” The library name identifies the library at the point in the chain where the linkage became circular. If the client process initiated the chain of circular linkages with a LINKLIBRARY function, the linkage fails and the function returns a value of –7.

Linkages That Cause the Client to Hang

Additionally, some incorrect types of circular linkage can result in the client process hanging indefinitely. This situation occurs if

In either case, the Y (Status Interrogate) system command shows the client process to have a STACK STATE of WAITING ON AN EVENT. However, the STATUS task attribute value remains ACTIVE, and the client process does not appear in the W (Waiting Mix Entries) system command display. This situation continues until an operator enters a DS (Discontinue) system command or until the system is halt/loaded.

For a correct example of circular library linkage, refer to ALGOL Circular Client Programs later in this section.