From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=BAYES_05 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 19 Sep 92 02:28:28 GMT From: seas.gwu.edu!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: Using Global Variables Message-ID: <1992Sep19.022828.11648@seas.gwu.edu> List-Id: In article <1992Sep18.235238.25207@nosc.mil> sampson@nosc.mil (Charles H. Samps on) writes: [stuff deleted] >So, my question now is: For those real-time systems for which global vari- >ables are used instead of expensive parameter passage, was that decision >based on inherent limitations of the hardware, lack of cleverness by the >compiler writers, or poor analysis of the actual costs of parameter pas- >sage? > In my very limited experience working with real-world real-time people, it's been mostly the last. There's a lot of folklore in real-time systems. One of the bits of folk wisdom is "parameters are expensive; globals are cheap." It's easier to just rely on the folk wisdom than to actually analyze or measure. Two bits of _my_ folk wisdom: (1) Fast enough is fast enough. Tweak (only) what you need to tweak. (2) It's easier to make a correct program fast than to make a fast program correct. Mike Feldman