Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!phigate!ehviea!sun4dts!derek From: derek@sun4dts.dts.ine.philips.nl (derek) Newsgroups: comp.lang.pascal Subject: Re: Goto's are okay Keywords: goto Message-ID: <654@sun4dts.dts.ine.philips.nl> Date: 5 Feb 91 12:01:00 GMT References: <2427@bnlux0.bnl.gov> <1991Jan27.074528.23487@tygra.UUCP> <1991Jan27.185044.19856@uwasa.fi> <1991Jan28.102509.5587@tygra.UUCP> <1991Feb3.231920.8462@syacus.acus.oz.au> Lines: 29 ian@syacus.acus.oz.au (Ian Joyner) writes: about concurrency, with which I agree, then says: >Avoiding globals is easy. If you find you have the urge to put in some >globals, chances are that you have found another class. If not they should >all be placed in an "application" class. Of course it is impossible to >avoid globals where the language isn't a suitable tool. I don't find >languages that don't have gotos or globals restrictive. It will probably >be common in the future, and noone will argue, because such languages >make the new generation of parallel and concurrent systems possible. This is all very true and good. However, I wonder what the memory ramifications are? In a program I'm writing at the moment (in good old 5.0 - waiting for an update to 6.0), I'm using globals to reduce the stack overhead in a recursive procedure - sounds dangerous, but I'm being careful - these are mainly work records for pushing things onto the heap, which is cleared before each recursion. With the possibilities of very many recursions and large lists of things on the heap, surely this is a place to use globals, as long as concurrency is not a problem. Of course, since I've not yet got into OOP, perhaps there is another way? Suggestions? I'm also experimenting with the Desqview API library. Here concurrency is certainly an issue, but globals can help in passing information between tasks in the same process. And that is what the critical region switches are for. Best Regards, Derek Carr DEREK@DTS.INE.PHILIPS.NL Philips I&E TQV-5 Eindhoven, The Netherlands Standard Disclaimers apply.