From: REH <spamjunk@stny.rr.com>
Subject: Re: C++0x and Threads - a poor relation to Ada's tasking model?
Date: Wed, 12 Aug 2009 14:15:10 -0700 (PDT)
Date: 2009-08-12T14:15:10-07:00 [thread overview]
Message-ID: <6d23274b-d649-4a83-a6f1-6d1e9c4c3998@d34g2000vbm.googlegroups.com> (raw)
In-Reply-To: wcc8whovk76.fsf@shell01.TheWorld.com
On Aug 12, 4:41 pm, Robert A Duff <bobd...@shell01.TheWorld.com>
wrote:
> The philosophy has nothing to do with "explicitly". And I don't
> understand why you said "potential". If you leave out those two words,
> as in "you don't take a performance hit for exceptions or
> range-checking, unless you use them," then I would agree with you 100%.
>
> The point is, if you use some feature X, you should not have
> to pay the cost of feature Y that you do not use, just because
> feature Y exists, and might have some interaction with feature
> X in some other program that DOES use Y with X.
>
> C++ and Ada both share this philosophy. It's called
> "avoid distributed overhead".
The reason I said "potentially" is you may or maybe pay the cost in
Ada, depending on the implementation. There are implementations where
you will always pay a speed penalty for exceptions (e.g., in setting
up the frame), and there are ones where you only pay if an exception
is raised (e.g., a table-based implementation). A C++ compiler will
not make me "pay" the cost of exceptions if I never make use of them.
What I mean by that is, if I don't have a try block, there will never
be any setup code to catch or propagate exceptions. In Ada, you may or
may not.
Similarly with range-checking. If I index an array in Ada, it may or
may not range check the index (a smart compiler can remove the check
if it can prove it cannot be out-of-range). C++ will not range check
the index. I have to do it explicitly (which is why I used that word),
or if I am using vectors, call the at member explicitly.
REH
next prev parent reply other threads:[~2009-08-12 21:15 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 15:30 C++0x and Threads - a poor relation to Ada's tasking model? John McCabe
2009-08-11 20:51 ` Maciej Sobczak
2009-08-12 12:25 ` John McCabe
2009-08-12 14:51 ` Maciej Sobczak
2009-08-12 15:56 ` REH
2009-08-12 16:59 ` John McCabe
2009-08-12 17:21 ` REH
2009-08-12 20:41 ` Robert A Duff
2009-08-12 21:15 ` REH [this message]
2009-08-13 1:28 ` Randy Brukardt
2009-08-13 2:08 ` REH
2009-08-13 8:38 ` Pascal Obry
2009-08-13 8:57 ` Dmitry A. Kazakov
2009-08-13 11:32 ` Pascal Obry
2009-08-13 12:28 ` Dmitry A. Kazakov
2009-08-14 1:15 ` Brian Drummond
2009-08-14 11:24 ` Language checks (Was: C++0x and Threads - a poor relation to Ada's tasking model?) Jacob Sparre Andersen
2009-08-14 12:01 ` Dmitry A. Kazakov
2009-08-14 13:33 ` REH
2009-08-14 13:48 ` John McCabe
2009-08-14 14:51 ` John McCabe
2009-08-14 14:13 ` Dmitry A. Kazakov
2009-08-14 19:58 ` Language checks Robert A Duff
2009-08-15 0:10 ` Language checks (Was: C++0x and Threads - a poor relation to Ada's tasking model?) Randy Brukardt
2009-08-14 13:10 ` C++0x and Threads - a poor relation to Ada's tasking model? Gautier write-only
2009-08-14 13:16 ` REH
2009-08-12 21:24 ` REH
2009-08-13 13:51 ` John McCabe
2009-08-13 16:24 ` REH
2009-08-14 11:09 ` John McCabe
2009-08-14 13:00 ` REH
2009-08-14 14:30 ` John McCabe
2009-08-14 14:49 ` REH
2009-08-14 14:54 ` John McCabe
2009-08-14 15:35 ` REH
2009-08-14 18:43 ` Robert A Duff
2009-08-14 18:54 ` REH
2009-08-14 22:33 ` Robert A Duff
2009-08-15 1:15 ` REH
2009-08-15 14:24 ` Robert A Duff
2009-08-14 15:09 ` Hyman Rosen
2009-08-14 15:12 ` REH
2009-08-13 13:55 ` John McCabe
2009-08-13 16:45 ` REH
2009-08-14 11:14 ` John McCabe
2009-08-12 20:53 ` Maciej Sobczak
2009-08-11 23:53 ` jimmaureenrogers
2009-08-12 0:06 ` Jeffrey R. Carter
2009-08-12 7:26 ` Maciej Sobczak
2009-08-12 5:29 ` stefan-lucks
2009-08-12 15:00 ` Maciej Sobczak
2009-08-12 9:27 ` Ludovic Brenta
2009-08-12 15:14 ` Maciej Sobczak
2009-08-13 12:47 ` Peter C. Chapin
2009-08-13 13:57 ` John McCabe
2009-08-14 7:39 ` Maciej Sobczak
2009-08-14 11:13 ` John McCabe
2009-08-14 12:23 ` Dmitry A. Kazakov
2009-08-14 12:50 ` John McCabe
2009-08-14 13:50 ` Dmitry A. Kazakov
2009-08-14 13:58 ` Niklas Holsti
2009-08-14 14:17 ` Dmitry A. Kazakov
2009-08-14 22:25 ` Brian Drummond
2009-08-14 12:56 ` John McCabe
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox