ILE C/C++ Programmer's Guide


Run-Time Library Functions and Activation Groups

The ILE C/C++ run-time library functions are bound to the application in the activation group in which the application is called. This means that:

In other words, if one program in an activation group changes the state of the ILE C/C++ run time, then all other programs in that activation group are affected. For example, other programs in the same activation group are affected by the locale setting of an application or the shift-in/shift-out states of the multibyte functions.

If the ACTGRP parameter of the CRTPGM command is specified to a value other than *NEW, the application's run-time behavior might not follow ISO C or ISO C++ standards. Non-ISO behavior may occur during:

In the default activation groups, I/O files are not automatically closed. The I/O buffers are not flushed.

If ACTGRP is set to *CALLER, multiple calls of an ILE C/C++ program share one instance of the ILE C/C++ run-time library state in the same activation group. Through this option, ILE C/C++ programs can run within the OPM default activation groups. Certain restrictions exist for ILE C/C++ programs that run in the OPM default activation groups. For example, you are not allowed to register atexit() functions within the OPM default activation groups.

If the activation group is named:

Note:
Constructors, destructors, and static initializations are executed only when the activation group is created.

It is possible to create an ISO-compliant application whose programs are created with options other than ACTGRP(*NEW).

Note:
It is the responsibility of the application designer to ensure that the sharing of resources, and run-time states across all programs in the activation group do not result in non-ISO behavior.


[ Top of Page | Previous Page | Next Page | Table of Contents ]