Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!caip!princeton!allegra!ulysses!mhuxr!mhuxt!houxm!ihnp4!alberta!calgary!ingoldsby From: ingoldsby@calgary.UUCP (Terry Ingoldsby) Newsgroups: net.micro.amiga Subject: Re: making reentrant code for "resident" programs Message-ID: <310@vaxb.calgary.UUCP> Date: Wed, 13-Aug-86 14:38:38 EDT Article-I.D.: vaxb.310 Posted: Wed Aug 13 14:38:38 1986 Date-Received: Thu, 14-Aug-86 20:45:22 EDT References: <661@usc-oberon.UUCP> <1468@amiga.amiga.UUCP> <870@tekigm.UUCP> <969@hoptoad.uucp> Organization: U. of Calgary, Calgary, Ab. Lines: 25 Summary: Re-entrant `C' Code In article <969@hoptoad.uucp>, gnu@hoptoad.UUCP writes: > In article <1478@amiga.amiga.UUCP>, jimm@amiga.UUCP (James D. Mackraz) writes: > > 2) Perhaps the Lattice C Compiler can create re-entrant code. > > There is no way an average C program can get by without using global > variables (eg errno, the standard-I/O file tables, etc). This means > that a facility to let programs be "reentrant", which does not provide > for separate data areas for each copy of the running, is foolhardy in a > portable C language environment. > > (It's not clear that this is specific to C. Know any programs that > have NO global variables and NO local static variables?) > > A properly written compiler can support reentrancy -- even in a system > without memory management -- by making global data references relative > to an address register (rather than using the slow, cumbersome absolute > addressing mode most compilers use). I don't know of any that do this, > however, since there are complications involved. > -- > John Gilmore {sun,ptsfa,lll-crg,ihnp4}!hoptoad!gnu jgilmore@lll-crg.arpa > May the Source be with you! If I'm not mistaken, the `C' Compilers written for the OS9 operating system do generate re-entrant code in the manner described by John Gilmore.