This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: exceptions and threads---a survival tactic!


Kaz Kylheku wrote:

> The potential bottleneck should not be a worry since
> in well designed programs (IMHO), exception handling is
> an infrequent occurence for, well, ``exceptional'' events.

You should look at some of the discussions in the comp.lang.c++.moderated
archive :-) You'll find that opinions about that vary widely.

The fact is, with properly implemented exception-handling code that *does*
care about runtime overhead, you can write much faster code by using EH for
flow control than by the traditional "if (foo) bar(); else baz();" method.
Typical applications that come to mind are complicated recursive-descent
parsers (one of the examples in c.l.c++.m was a MIDI interpreter).

Besides, you can use lean-and-mean EH for "exceptional events only" designs
quite easily...

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]