Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

IBM-MAIN - Speicherklassen static und auto in C, PL/1, COBOL, ASSEMBLER ...

Subject:

use of STATIC storage (was: Re: abend S602-0 when in AMODE 64)

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>

Date:

2015.01.17 19:34:00


At my recent site, we wanted all programs to be naturally reentrant
for several reasons ... no matter, if PL/1, ASSEMBLER, or C.

With the old compilers, we achieved this by telling the developers that the
STATIC variables must not be changed during execution. We had some
test systems that allowed for runtime checks (storage protecting the
module area, and then monitoring the 0C4 abends resulting from
stores into the module area).

With the new PL/1 compiler, we can enforce this by assigning implicitly
NONASSIGNABLE to all STATIC definitions; this is a sort of additional
control.

If sometimes for special reasons, there is a need to store some information
into the static area, the variables have to be defined explicitly with the ASGN
attribute.

One such reason could be:

The module stores the parameters of the last call and the results in the
STATIC area, and if the parameters on the next call are the same,
it simply outputs the result, without computing again. Of course, you
have to take care that this works correctly in a multi-threaded environment.

Kind regards

Bernd



Am 17.01.2015 um 18:36 schrieb J.G.:
> Note also that the chief value of the PL/I attributes ASSIGNABLE and
> NONASSIGNABLE is in the characterization of procedure parameters.
>
> J.G.
>

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie