Why dont RealTime Embedded programmers use Exception Handling? - Embedded

This is a discussion on Why dont RealTime Embedded programmers use Exception Handling? - Embedded ; I have seen at several places that C++ programmers writing for RealTime Embedded applications dont use Exception Handling. They dont like Throw/catch concept. WHY?...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Why dont RealTime Embedded programmers use Exception Handling?

  1. Why dont RealTime Embedded programmers use Exception Handling?

    I have seen at several places that C++ programmers writing for RealTime
    Embedded applications dont use Exception Handling. They dont like
    Throw/catch concept. WHY?


  2. Re: Why dont RealTime Embedded programmers use Exception Handling?

    On 2006-07-17, NewToEmbeddedLinux wrote:

    > I have seen at several places that C++ programmers writing for
    > RealTime Embedded applications dont use Exception Handling.
    > They dont like Throw/catch concept. WHY?


    The concept is fine.

    The way it's implemented in C++ makes it difficult to avoid
    pitfalls like memory leaks and just plain being a memory hog.

    --
    Grant Edwards grante Yow! - if it GLISTENS,
    at gobble it!!
    visi.com

  3. Re: Why dont RealTime Embedded programmers use Exception Handling?

    "NewToEmbeddedLinux" wrote in message
    news:1153169211.280510.318220@m79g2000cwm.googlegr oups.com...
    > I have seen at several places that C++ programmers writing for RealTime
    > Embedded applications dont use Exception Handling. They dont like
    > Throw/catch concept. WHY?


    Exception handling in C++ is often implemented with table searches and
    stack-frame walking. The time taken to process an exception can be large
    even for user initiated exceptions (throw), while exceptions driven by
    hardware (access violation, FPU) have additional overheads. So, if the
    exception only occurs in non-RT part of the application then all is well but
    otherwise...

    Peter



  4. Re: Why dont RealTime Embedded programmers use Exception Handling?

    Peter:

    How does the implementation with table searches and stack-frame walking
    decrease the performance?

    How do we catch the exceptions driven by the hardware? the C++
    exception are caught if exceptions are thown.. right?

    Thanks.


    Peter Dickerson wrote:
    > "NewToEmbeddedLinux" wrote in message
    > news:1153169211.280510.318220@m79g2000cwm.googlegr oups.com...
    > > I have seen at several places that C++ programmers writing for RealTime
    > > Embedded applications dont use Exception Handling. They dont like
    > > Throw/catch concept. WHY?

    >
    > Exception handling in C++ is often implemented with table searches and
    > stack-frame walking. The time taken to process an exception can be large
    > even for user initiated exceptions (throw), while exceptions driven by
    > hardware (access violation, FPU) have additional overheads. So, if the
    > exception only occurs in non-RT part of the application then all is well but
    > otherwise...
    >
    > Peter



  5. Re: Why dont RealTime Embedded programmers use Exception Handling?

    On 2006-07-18, NewToEmbeddedLinux wrote:

    > How does the implementation with table searches and
    > stack-frame walking decrease the performance?


    Compared to _not_doing_ table searches and stack-frame walking,
    _doing_ them takes a lot of time.

    > How do we catch the exceptions driven by the hardware?


    You mean interrupts? The hardware causes an ISR to be called.

    > the C++ exception are caught if exceptions are thown.. right?


    I suppose so, unless your compiler and runtime library are
    broken.

    I've also been told by C++ experts that exceptions, when
    combined with some other features you get almost unavoidable
    memory leaks. I don't remember the exact combinations, and the
    "experts" may have been wrong, but IMO C++ is sufficiently
    opaque that usage of anything other than a carefully screened
    subset of it's features is just too dangerous.

    [Yes, I think that's true for general purpose applications
    programming as well.]

    --
    Grant Edwards grante Yow! If elected, Zippy
    at pledges to each and every
    visi.com American a 55-year-old
    houseboy...

+ Reply to Thread