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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,df854b5838c3e14 X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,df854b5838c3e14 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,df854b5838c3e14 X-Google-Attributes: gid103376,public X-Google-Thread: 10db24,fec75f150a0d78f5 X-Google-Attributes: gid10db24,public From: austern@isolde.mti.sgi.com (Matt Austern) Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada) Date: 1996/04/10 Message-ID: #1/1 X-Deja-AN: 146763646 references: followup-to: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu organization: SGI reply-to: austern@mti.sgi.com newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu Date: 1996-04-10T00:00:00+00:00 List-Id: In article <4kgmgu$jm@galaxy.ucr.edu> thp@cs.ucr.edu (Tom Payne) writes: > The problem shows up in real situations: In C++ AFAIK there is no > efficient way for an exception at the hardware level to generate an > exception (in the C++ sense) on the part of the running program -- the > running must poll a volatile atomic variable to see if the exception > has occurred. This obviously makes the langauge, as defined in the > standard, unacceptable for use in the area of, say, embedded systems. > Even in scientific progrmming, however, one would like to be able to > throw an exception out of a matrix manipulation routine when the > underlying hardware detects a floating point exception, and polling > for such an occurrence would involve unacceptable overhead. Are you sure that this is possible on the machines that you'd like your program to run on? On many of today's RISC chips, after all, floating point exceptions are asynchronous: you have no way of knowing which instruction caused the problem. (This sounds perverse, but there's a reason for it. If you want synchronous exceptions, you end up having to stall the pipeline when you're processing a floating point instruction.) -- Matt Austern SGI: MTI Compilers Group austern@isolde.mti.sgi.com