Activation group ending

The i5/OS™ Integrated Language Environment® (ILE) program model uses activation groups as a way to encapsulate resources for an application program within a job.

When multiple threads exist in the processes that possibly use the activation group, the system cannot end that activation group in a predictable and safe way. To solve this problem, the system changes the behavior of ending an activation group in a multithreaded job.

If a secondary thread in a multithreaded application performs an action that ends an activation group (for example, C functions exit() or abort()) or fails to prevent an activation group from ending, the system takes action to end the process at that time. If the initial thread in an multithreaded application performs an action that ends an activation group or fails to prevent an activation group from ending, the system ends the activation group but does not end the process.

A typical example of this occurs when a current i5/OS application is altered to take advantage of multithreading. The current i5/OS application probably uses multiple program objects. Unlike other platforms, i5/OS allows you to call the programs within the same process context as the currently running application code.

The default activation group attribute for a program is *NEW. Calling a program with a default activation of *NEW in a multithreaded job ends both the activation group and the process when the program ends. If the job is to remain active after the program ends, the program should be changed to use the *DEFAULT or a named activation group.