Thawing a Library

Thawing a library is the act of changing a permanent library into a temporary library. A temporary library automatically resumes execution as soon as it has no more users. By contrast, a permanent library remains frozen indefinitely. Thawing a permanent library is thus a first step toward removing the library process from usage (for example, because you want a newer version of the library program to be used). Thawing the library is less drastic than discontinuing the library process with a DS (Discontinue) system command or a STATUS assignment of TERMINATED.

You can design a program to thaw a library process by assigning either of two values to the STATUS task attribute: ACTIVE or GOINGAWAY. Effects of GOINGAWAY and ACTIVE Assignments summarizes the differences in the effects of these two assignments.

Table 5. Effects of GOINGAWAY and ACTIVE Assignments

Effects

GOINGAWAY Assignment

ACTIVE Assignment

Time Execution Resumes

When there are no more users

When there are no more users

New Users of Shared Libraries

Are linked to a new invocation of the latest version of the library object code file

Are linked to the existing library process

STATUS Task Attribute

ACTIVE

FROZEN

WFL Task State

ACTIVE, INUSE

ACTIVE, INUSE

Mix Commands

A, J, MX

LIBS

Y Stack State

WAITING ON AN EVENT

FROZEN


The key difference between GOINGAWAY and ACTIVE assignments is that the GOINGAWAY assignment prevents any additional user processes from linking to the library process. For libraries that are shared by many users, this can make a big difference in how long the library process takes to resume execution. If you use an assignment of ACTIVE instead, new processes can continue linking to the (newly temporary) library, with the result that the library remains frozen indefinitely.

Note that neither the GOINGAWAY assignment nor the ACTIVE assignment actually changes the STATUS task attribute to the requested value. After a GOINGAWAY assignment, the STATUS value is ACTIVE. GOINGAWAY is therefore never returned as a value when a process reads the STATUS task attribute. By contrast, after an ACTIVE assignment, the STATUS remains FROZEN until there are no more users of the library. Then the library STATUS changes to ACTIVE and the process resumes execution.

You can thaw a library interactively with the THAW (Thaw Frozen Library) system command. This command has the same effect as assigning a value of ACTIVE to the STATUS task attribute.