Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!spdcc!m2c!ulowell!page From: page@ulowell.cs.ulowell.edu (Bob Page) Newsgroups: comp.sys.amiga Subject: Re: Use of Resident Message-ID: <1895@ulowell.cs.ulowell.edu> Date: Sat, 24-Oct-87 13:55:24 EST Article-I.D.: ulowell.1895 Posted: Sat Oct 24 13:55:24 1987 Date-Received: Mon, 26-Oct-87 05:24:09 EST References: <4086@garfield.UUCP> Reply-To: page@swan.ulowell.edu (Bob Page) Distribution: na Organization: University of Lowell, Department of Redundancy Dept. Lines: 25 john13@garfield.UUCP (John Russell) wrote: >I recently read that non-reentrant programs can still be made resident as >long as you only attempt to run one copy at a time. Absolutely untrue. Suppose you have global variables in your program. On startup they're zero. Your program mucks around with them, then exits. The data stays resident too, not just the text. You start up your program again, your program uses the data from the last run. That includes things like loop counters, File Handles, Window Pointers, devices, etc, which might not be there any more. Guess what happens... Sure, you could program around this by always freeing and zeroing everything you use on exit, and zeroing everything on startup, but you can't depend on other programmers to do that, and even so, there are other dangers of RESIDENT lurking, which I have more than once discussed here. Don't use RESIDENT. The concept is great; the implementation flawed. Wait until there's one that works. ..Bob -- Bob Page, U of Lowell CS Dept. page@ulowell.{uucp,edu,csnet}