Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: net.micro.amiga Subject: Re: making reentrant code for "resident" programs Message-ID: <969@hoptoad.uucp> Date: Tue, 12-Aug-86 04:32:01 EDT Article-I.D.: hoptoad.969 Posted: Tue Aug 12 04:32:01 1986 Date-Received: Tue, 12-Aug-86 23:32:44 EDT References: <661@usc-oberon.UUCP> <1468@amiga.amiga.UUCP> <870@tekigm.UUCP> <1478@amiga.amiga.UUCP> Organization: Nebula Consultants in San Francisco Lines: 20 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!