Explicitly Initiating a Server Library

Synchronous Tasks Cannot Freeze

A server library process can be explicitly initiated by a process initiation statement in a program. However, the resulting process can freeze only if it is an independent process or an asynchronous dependent process. If the program is initiated as a synchronous dependent process, by a WFL RUN statement, for example, then when the process attempts to freeze, it is discontinued with the error “FREEZE FAILED, TASK TYPE NOT PROCESS OR RUN.”

Freeze Duration

When a server library process is meant to be explicitly initiated, the library should typically specify a freeze duration of PERMANENT or CONTROL. If the freeze is TEMPORARY, then the process can freeze successfully only if the process is an internal process initiated by a PROCESS statement.

Library Sharing

For server libraries that are explicitly initiated, some special considerations apply to the sharing option. If the sharing option is PRIVATE or SHAREDBYRUNUNIT, then the server library instance is not directly available to client processes. However, such a server library instance can serve as a secondary library in a dynamic provision mechanism. (This type of linkage is discussed under Dynamic Provision later in this section.) If the sharing option is SHAREDBYALL or DONTCARE, then any client process can link to that server library instance.

Determining How a Library Was Initiated

A server 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. For example, an ALGOL program can use the following expression to determine whether it was initiated by the library linkage mechanism:

IF BOOLEAN (MYSELF.LIBRARYSTATE) THEN…