> -----Original Message----- > From: IBM Mainframe Discussion List On Behalf Of John McKown > > 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.
OK, so what's the difference between "reentrant" (or "re-enterable") and "threadsafe"? CICS (e.g.) asserts there is a difference: DFHSIT parm RENTPGM=[PROTECT | NOPROTECT] and PROGRAM attribute CONCURRENCY=[THREADSAFE | QUASIRENT], each independent of the other. RENTPGM=PROTECT causes CICS to allocate its RDSAs in key-0 storage, while CONCURRENCY=THREADSAFE causes CICS to leave programs running on an "open" TCB between resource manager (usually DB2) calls, or until the program issues a "non-threadsafe" EXEC CICS command. -jc- ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html