niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » embedded
Why dont RealTime Embedded programmers use Exception Handling?
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
Grant Edwards
*nix forums Guru


Joined: 21 Feb 2005
Posts: 1227

PostPosted: Tue Jul 18, 2006 6:05 pm    Post subject: Re: Why dont RealTime Embedded programmers use Exception Handling? Reply with quote

On 2006-07-18, NewToEmbeddedLinux <hetzme@yahoo.com> wrote:

Quote:
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.

Quote:
How do we catch the exceptions driven by the hardware?

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

Quote:
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...
Back to top
NewToCPP
*nix forums beginner


Joined: 08 Dec 2005
Posts: 31

PostPosted: Tue Jul 18, 2006 5:56 pm    Post subject: Re: Why dont RealTime Embedded programmers use Exception Handling? Reply with quote

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:
Quote:
"NewToEmbeddedLinux" <hetzme@yahoo.com> wrote in message
news:1153169211.280510.318220@m79g2000cwm.googlegroups.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
Back to top
Peter Dickerson
*nix forums beginner


Joined: 11 Apr 2006
Posts: 2

PostPosted: Tue Jul 18, 2006 6:36 am    Post subject: Re: Why dont RealTime Embedded programmers use Exception Handling? Reply with quote

"NewToEmbeddedLinux" <hetzme@yahoo.com> wrote in message
news:1153169211.280510.318220@m79g2000cwm.googlegroups.com...
Quote:
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
Back to top
Grant Edwards
*nix forums Guru


Joined: 21 Feb 2005
Posts: 1227

PostPosted: Mon Jul 17, 2006 9:01 pm    Post subject: Re: Why dont RealTime Embedded programmers use Exception Handling? Reply with quote

On 2006-07-17, NewToEmbeddedLinux <hetzme@yahoo.com> wrote:

Quote:
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
Back to top
NewToCPP
*nix forums beginner


Joined: 08 Dec 2005
Posts: 31

PostPosted: Mon Jul 17, 2006 8:46 pm    Post subject: Why dont RealTime Embedded programmers use Exception Handling? Reply with quote

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?
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 11:30 pm | All times are GMT
navigation Forum index » *nix » Linux » embedded
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Virtual Machine that can run embedded Linux TCM embedded 1 Thu Jul 20, 2006 5:20 pm
No new posts Win32::OLE and CAPICOM to find a certificate in certifica... dan2online Perl 0 Thu Jul 20, 2006 6:47 am
No new posts Win32::OLE and CAPICOM to find a certificate in certifica... dan2online modules 0 Thu Jul 20, 2006 6:44 am
No new posts connecting to the embedded server Frank MySQL 2 Wed Jul 19, 2006 8:41 pm
No new posts Bug#378734: ITP: axtls -- TLSv1 SSL library designed for ... Roberto Lumbreras devel 0 Tue Jul 18, 2006 4:40 pm

Car Loan | Cell Phones | Credit Counseling | Loans | Car salvage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1653s ][ Queries: 20 (0.0662s) ][ GZIP on - Debug on ]