Answered in the Wikipedia article. <quote> Relation to thread safety It must not be confused with thread-safe. A function can be thread-safe and still not reentrant. For example, a function could be wrapped all around with a mutex which avoids problems in multi-threading environments, and if that function is used as reentrant in an interrupt service routing, could starve waiting for the first execution to release the mutex. The key for avoiding confusion is that reentrant refers to only ONE thread executing. It is a concept from the time when no multi-tasking operating systems existed. </quote>
I don't know if I agree with this or not. I admit to becoming a tad confused on this point. I guess, IMO, all of these type of programs should be designed so that: (1) they give the correct result even if interrupted by the OS and the same code is re-entered by this unit of work (re-entrant by the Wiki article); (2) they give the correct result even if executed in parallel on multiple CPUs in the same time interval by different units of work (thread-safe by the Wiki article). Note that neither of these are the same as REFR, which I think basically means that the code is not self modifying and, if necessary, can be reloaded from DISK without ill effect. Like SVCs back in the days of the SVC transient area (for MVT, SVS, and VS1 people). One example that I remember from long ago was if a real page frame failed, the OS could simply assign a new frame, page in the code from disk, then restart the failing instruction. This works for REFR programs. It won't work if the data in the page frame had been changed in any way. -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * [email protected] * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM ---------------------------------------------------------------------- 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

