REENTRANT Program: Re-entrancy is a useful, memory-saving technique for multiprogrammed timesharing systems. A Reentrant Procedure is one in which multiple users can share a single copy of a program during the same period. Reentrancy has 2 key aspects: * The program code cannot modify itself. * The local data for each user process must be stored separately. Thus, the permanent part is the code, and the temporary part is the pointer back to the calling program and local variables used by that program. Each execution instance is called activation. It executes the code in the permanent part, but has its own copy of local variables/parameters. The temporary part associated with each activation is the activation record. Generally, the activation record is kept on the stack. Note: A reentrant procedure can be interrupted and called by an interrupting program, and still execute correctly on returning to the procedure.
REFR The module is refreshable. It can be replaced by a new copy during execution without changing the sequence or results of processing. A refreshable module cannot be modified during execution. A module can only be refreshable if all the control sections within it are refreshable. The refreshable attribute is negated if any input modules are not refreshable. Refreshable modules are also reenterable and serially reusable. The refreshable attribute can be specified for any nonmodifiable module. If REFRPROT has been specified on the SETPROG command or in parmlib member PROGxx, the module is protected from modification by placing it in key 0, non-fetch protected storage, and page protecting the whole pages. Note that debuggers, such as TSO TEST and UNIX debugging environments, will override REFRPROT protection for particular TCBs so that they can modify module storage in order to set breakpoints. Regards Otto Schumacher HP Enterprise Services Infrastructure Specialist Ahold Account CICS & Capacity Technical Support P.O. Box 6462 2000 Wade Hampton Blvd. LC1-302 Greenville, South Carolina, 29606 Cell: 864 569--5338 Tel: 864 987-1417 Fax: 864 987-4500 E-mail: [email protected] -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of John McKown Sent: Tuesday, July 19, 2011 5:28 PM To: [email protected] Subject: Re: Re-entrant module stores into itself with no 0C4 Just to be my usual self. In general in CS, "reentrant" does not mean "non-self modifying". Many programs which do not modify themselves are still not reentrant due to uncoordinated updating of shared resources. Likewise, if done properly a self modifying program can still be reentrant. ref: http://en.wikipedia.org/wiki/Reentrant_%28subroutine%29 <quote> In computing, a computer program or subroutine is called reentrant if it can be interrupted in the middle of its execution and then safely called again before its previous invocations complete executing. </quote> simple non-reentrant code example: L R1,SOMEVALUE AHI R1,+1 ST R1,SOMEVALUE Note that it is possible for the program to be interrupted after the L and before the ST and some other function (or another task running this function) to update SOMEVALUE. So SOMEVALUE can become corrupted (update lost). IIRC, non-self modifying code is called "pure code" in UNIX. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

