home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.programming
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!ktbush.ogo.dec.com!mjg
- From: mjg@ktbush.ogo.dec.com (Michael J. Grier)
- Subject: Re: reentrant code
- Message-ID: <1992Dec13.221314.26971@nntpd.lkg.dec.com>
- Lines: 43
- Sender: usenet@nntpd.lkg.dec.com (USENET News System)
- Reply-To: mjg@ktbush.ogo.dec.com (Michael J. Grier)
- Organization: Digital Equipment Corporation
- References: <GARY.92Dec9104702@kuwait.gdfwc3> <1992Dec10.045716.12505@linus.mitre.org> <dak.724201089@messua> <1992Dec13.051634.14815@linus.mitre.org>
- Date: Sun, 13 Dec 1992 22:13:14 GMT
-
-
- In article <1992Dec13.051634.14815@linus.mitre.org>, crawford@boole.mitre.org (Randy Crawford) writes:
- |>
- |>>The problems of reentrancy are a bit different from concurrency.
- |>
- |>True, but reentrancy is irrelevant unless concurrency in some form (like
- |>context switching) is involved.
- |>
-
- Untrue. Consider a module which implements an abstraction of a queue
- or other searching structure, which provides a service for iteration on the
- data structure. If you specify the service such that the caller provides
- a function to execute for each element in the structure, there is again
- a need for reentrancy controls of some fashion.
-
- The reentrancy controls may be as simple as documenting, "Do not attempt
- to modify the data structure from the callback function. If you do, the
- world may come crashing down about your ears."
-
- On the other hand, you might try to do something more intelligent and/or
- pro-active in the area, either setting a "busy" flag for the data structure,
- and/or making a copy of the data before beginning the iteration process.
- This takes time and memory. [I prefer to provide both sorts of interfaces -
- ones which are faster but have more operational constraints, and safer ones
- which cost more.]
-
- My point is that reentrancy isn't a Boolean valued quality of a particular
- service/procedure/function. You may be reentrant from a signal point of
- view, but not from a multi-threaded point of view. My first example does not
- use concurrency according to any definition with which I am familliar.
-
- |>
- |>| Randy Crawford crawford@mitre.org The MITRE Corporation
- |>| 7525 Colshire Dr., MS Z421
- |>| N=1 -> P=NP 703 883-7940 McLean, VA 22102
- |>
-
- ------------------------------------------------------------------------
- I'm saying this, not Digital. Don't hold them responsibile for it!
-
- Michael J. Grier Digital Equipment Corporation
- (508) 496-8417 mjg@ktbush.dec.com
- Stow, Mass, USA Mailstop OGO1-1/E16
-