Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!ucla-cs!pegasus!cc1 From: cc1@pegasus.cs.ucla.edu (Michael Gersten) Newsgroups: net.micro.amiga Subject: Re: making reentrant code for "resident" programs Message-ID: <576@curly.ucla-cs.ARPA> Date: Fri, 15-Aug-86 15:13:43 EDT Article-I.D.: curly.576 Posted: Fri Aug 15 15:13:43 1986 Date-Received: Sun, 17-Aug-86 08:21:26 EDT References: <661@usc-oberon.UUCP> <1468@amiga.amiga.UUCP> Reply-To: occ4mgk@oac.ucla.edu, cc1@pegasus.UUCP (Michael Gersten) Organization: Ucla Computer Club (disclaimer) Lines: 17 This is similar to what someone suggested a while back, namely having a program consist mostly of library routines so they would be shared. The benefit of arrainging the program as library routines is that A. They get kicked out of memory when needed B. They can use globals How? Simple. First, when a task does an open library, the open routine allocates a block for that tasks globals. Second, all references in the source to globals are macro's that expand to a subroutine call. Third, all routines that use globals are surrounded by forbit/permit pairs. This allows all parts of a program that don't do Wait() to be put in as libraries. Michael Gersten Views expressed here may not be those of the Computer Club, UCLA, or anyone in their left OR right mind. And that's the name o' that tune.