From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public From: dmitrik@my-dejanews.com Subject: Re: Real-time dyn allctn (was: Ada vs C++ vs Java) Date: 1999/01/28 Message-ID: <78on0o$9rb$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 437565228 References: <369C1F31.AE5AF7EF@concentric.net> <369DDDC3.FDE09999@sea.ericsson.se> <369e309a.32671759@news.demon.co.uk> <77mu1h$n6m$1@galaxy.mchh.siemens.de> <77no7p$d65$1@nnrp1.dejanews.com> <78i6m3$505$4@plug.news.pipex.net> <78im07$86a$1@nnrp1.dejanews.com> <78lv2n$dpl$2@plug.news.pipex.net> X-Http-Proxy: 1.0 cache.syd.computershare.com.au:8080 (Squid/2.1.PATCH2), 1.0 fmsc-gw.fmsc.com.au:8080 (Squid/2.1.PATCH2), 1.0 x9.dejanews.com:80 (Squid/1.1.22) for client 172.28.9.3, 172.28.8.60, 203.4.181.65 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Jan 28 03:54:03 1999 GMT Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) Date: 1999-01-28T00:00:00+00:00 List-Id: In article <78lv2n$dpl$2@plug.news.pipex.net>, "Nick Roberts" wrote: > I suppose it depends on how hard is 'hard', but I think the answer is 'yes'. > For example, a certain well-known brand of laser printers implements a > stack-based PDL, and it uses code, inside its ROM, which is effectively > recursive, to interpret this PDL. Recent models of these (and other) > printers also use a highly sophisticated system of dynamic memory allocation > and management (including garbage collection and data compression). Definitely not hard enough. How about "Stack Overflow", "Out of memory" or "Page too Complex" printed nicely on top of otherwise blank page coming ouf of certain well-known brand of laser printer? Or a suggestion to install more memory in User Manual? They've got a big reset button on the front panel after all. > Another example: a certain military mapping program uses an reverse Polish > coding to encode the map data. The code used to unravel and display this > data uses recursive-descent. Of course, we could have used loops, but it > would have been a minor nightmare to do so. The program worked just fine. Was it really *hard real-time* app? As I understand in situations like this you've got only 3 choices: a) Stick another (64) megabytes and hope it won't blow up. b) Handle stack overflow "gracefully" with a message "Unable to process all your data. Some enemy missiles will not be intercepted". c) Statically *prove* your recursion is limited and enough stack space is available under any circumstances. What choice did you make BTW? Dmitri > > Plainly, the use of recursive calls will be impossible (or at least > foolhardy) for many applications, and for many others it will simply be > unnecessary. But why forbid it? There will also be some applications where > recursion is a pain to avoid, and many where such avoidance is not really > necessary. > > ------------------------------------------- > Nick Roberts > ------------------------------------------- > > robert_dewar@my-dejanews.com wrote in message > <78im07$86a$1@nnrp1.dejanews.com>... > |Recursion in a hard real time program? You certainly work > |in a different environment from what I am used to. I am > |used to recursion being forbidden, as in OCCAM, precisely > |to allow static analysis of maximum storage use. > > -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own