Connection library processes can be initiated in either of two ways: implicitly, because of a LINKLIBRARY function, or explicitly, by a process-initiation statement in another process.
Implicitly Initiating a Connection Library
Library Linkage Mechanism
If a connection library process attempts to link to another connection library, and no appropriate instance of the responding connection library is currently available, then the requesting library process enters a waiting state. The STATUS task attribute is still ACTIVE, but the stack state in the Y (Status Interrogate) system command is WAITING ON AN EVENT. The library linkage mechanism of the operating system automatically initiates the program containing the responding connection library. The responding connection library program executes normally and at some point executes a READYCL function for the connection library. At this point, the system completes the linkage between the requesting library and the responding library, and the requesting library process resumes execution.
Multiple Library Instances
Even if an instance of the responding connection library program is already available, the system might initiate a new instance of the library program for the requesting library to link to. For example, if the sharing option of the connection library is PRIVATE, then the system initiates a new instance of the connection library program each time a process attempts to link to the connection library.
SHAREDBYALL Libraries with All Connections in Use
If the requesting library attempts to link to a responding library program that is SHAREDBYALL, and no connections of the responding library are available for use, the linkage attempt fails immediately and returns an error result. The system does not initiate a new instance of the responding library program.
Programs That Cannot Become Libraries
If the process attempts to link to a program that is not capable of becoming either a server library or a connection library, then the library linkage mechanism issues the error “LIBRARY WAS NOT INITIATED: <library name>.” This error can happen, for example, if the client process attempts to link to an ALGOL program that does not contain a FREEZE statement or a READYCL function.
Programs That Never READYCL or FREEZE
Because a library program initially runs as a regular program, the flow of execution can be such that the execution of a READYCL function or FREEZE is conditional. If the library linkage mechanism initiates such a program, and the resulting process terminates without ever having executed a READYCL function or FREEZE statement, the library linkage fails and the LINKLIBRARY function returns an error.
Explicitly Initiating a Connection Library
Process Initiation Statements
A program containing connection libraries can be explicitly initiated by a process initiation statement, just like any other program.
Types of Library Processes
Connection library programs can be initiated as any type of process: independent, synchronous dependent, or asynchronous dependent. (By contrast, server libraries cannot be initiated as synchronous dependent processes.)
Internal Tasks
In ALGOL programs, an internal procedure can be initiated as a task and can later participate in connection library linkages by executing READYCL or LINKLIBRARY functions. NEWP programs marked with UNSAFE(TASKING) status also have this capability. However, to simplify this discussion, this section discusses connection library processes as if they were always executions of an entire program.
Sharing Option
For connection library programs that are explicitly initiated, some special considerations apply to the sharing option. If other processes need to be able to link to the connection library instance, then a sharing option of SHAREDBYALL must be used. However, the connection library program can initiate linkages to other processes regardless of whether its own sharing value is SHAREDBYALL, PRIVATE, or SHAREDBYRUNUNIT.
Determining How the Program Was Initiated
A connection library program can determine whether it was initiated explicitly or by the library linkage mechanism by interrogating the LIBRARYSTATE task attribute. Bit [0:1] of the LIBRARYSTATE value stores a 1 if the process was initiated by the library linkage mechanism.

