Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!lll-crg!nike!ucbcad!ucbvax!jade!topaz!pete From: pete@topaz.berkeley.edu Newsgroups: net.micro.amiga Subject: Re: beta 4 (& re-entrant code) Message-ID: <1103@jade.BERKELEY.EDU> Date: Sun, 17-Aug-86 03:36:21 EDT Article-I.D.: jade.1103 Posted: Sun Aug 17 03:36:21 1986 Date-Received: Mon, 18-Aug-86 00:40:21 EDT References: <661@usc-oberon.UUCP> <1468@amiga.amiga.UUCP> <870@tekigm.UUCP> Sender: usenet@jade.BERKELEY.EDU Reply-To: pete@topaz.berkeley.edu.UUCP (Pete Goodeve) Distribution: net Organization: University of California, Berkeley Lines: 36 In article <870@tekigm.UUCP> phils@tekigm.UUCP (Phil Staub) writes: >In article <1468.....> neil@rocky.UUCP (Neil Katin) writes: >> >>HOWEVER, your code needs to be fully reentrant to live on this list. >>Neither lattice C nor emacs are reentrant. It turns out that all BCPL >>programs are. C programs can be written so that they are reentrant, >>but they typically are not. >> > >Question: > >I am interested to know what it is about the lattice C compiler that >generates non-reentrant code. I am not familiar with this compiler, >but (at least according to my understanding) any code which does not utilize >static or extern variables (i.e., only uses automatics or registers) should >be re-entrant in C. I also know that with some compilers, functions which >return structures do so in a non-reentrant way. Are these the only >non-reentrancies to which you refer, or is there a gap in my understanding >about reentrancy, or is there something else about Lattice which is >non-reentrant. > >Thanks The only thing that is really non-reentrant about (any) C on the Amiga is the way start-up is handled. Certain static locations -- defined at the assembly level -- are filled with items like the top and base of the stack, pointer to the command line, and so on. If you try to enter the same loaded segment of code (with the same static data area) a second time, you're bound to screw things up. The answer has to be to write an alternative startup.obj that puts the data somewhere that's exclusive to that process. I'm working on't.... Pete G.