Writing reentrant code is a good idea, but requires extra care, and work.  It's 
best to use macros for program entry, and exit, for consistency, that will 
setup program linkage correctly and allow for the allocation of extra storage, 
besides the program's safe area.  Reentrant programs must store any information 
in the program's work storage which is dynamically acquired using GETMAIN, or 
STORAGE macros, because they are not allowed to modify the program's area.
Reentrant programs are typically in LPALIB.  These programs are shared by many 
program's and are therefore loaded in the LPA, or ELPA. If a shared program is 
not reentrant,  it will typically ABEND with an S0C4.
The HLASM has a RENT option to make it check the code for compliance, and the 
BINDER option RENT, will mark the program as reentrant in the directory entry.  
You will also have to decide to make a programs AMODE and RMODE for at least 31 
bit addressing, so they may be loaded above the 16MB Line.

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf of 
Richard Zierdt <[email protected]>
Sent: Friday, August 23, 2024 12:20:06 PM
To: [email protected] <[email protected]>
Subject: Non-reentrant program not allowed (where?); Advantages of reentrant 
programs?

Some assembly textbook authors advise always writing reentrant code "because 
you never know if your program will be" [placed in some library / system space].
The question is: where (e.g. what libraries) must programs be reentrant to be 
"allowed in" ?
Besides specific libraries (if any), are there other advantages to reentrant 
code ?
Thanks -- 
Richard Zierdt

Confidentiality Warning/Avertissement de confidentialité:

This message is intended only for the named recipients. This message may 
contain information that is privileged or confidential. If you are not the 
named recipient, its employee or its agent, please notify us immediately and 
permanently destroy this message and any copies you may have. Ce message est 
destiné uniquement aux destinataires dûment nommés. Il peut contenir de 
l'information privilégiée ou confidentielle. Si vous n'êtes pas le destinataire 
dûment nommé, son employé ou son mandataire, veuillez nous aviser sans tarder 
et supprimer ce message ainsi que toute copie qui peut en avoir été faite.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to