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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4215feeab2a8154a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!p9g2000vbl.googlegroups.com!not-for-mail From: REH Newsgroups: comp.lang.ada Subject: Re: C++0x and Threads - a poor relation to Ada's tasking model? Date: Wed, 12 Aug 2009 19:08:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <7q2385104kihs87d79p8kfphuoki6r01vq@4ax.com> <7961a91c-a5af-40e2-bbc0-6bf69a98176d@z31g2000yqd.googlegroups.com> <362f621e-a01c-4772-ba02-4e18e9962188@j19g2000vbp.googlegroups.com> <128d63da-361f-4e33-be5e-e06bdc71e39f@r34g2000vba.googlegroups.com> <6d23274b-d649-4a83-a6f1-6d1e9c4c3998@d34g2000vbm.googlegroups.com> NNTP-Posting-Host: 69.205.133.144 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1250129320 26399 127.0.0.1 (13 Aug 2009 02:08:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 13 Aug 2009 02:08:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p9g2000vbl.googlegroups.com; posting-host=69.205.133.144; posting-account=GwkXCgoAAABFSG45Q--uHVZG6zn6ec-e User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7711 Date: 2009-08-12T19:08:40-07:00 List-Id: On Aug 12, 9:28=A0pm, "Randy Brukardt" wrote: > It seems to me that you are says Ada and C++ are exactly the same here. T= he > cost for exception handling in Ada only exists if you have an exception > handler. I've never seen an Ada implementation that has any overhead for = a > frame that doesn't contain a handler - it would be a horrible performance > drag. That's essentially equivalent to the C++ situation, as a "try block= " > is roughly equivalent to an Ada block with an exception handler. (Ada jus= t > allows handlers in more places.) The point was an Ada program will most likely have to code in it to handle exceptions. C++ may not. And before you start: I am not saying one way is better. > Range checking is very cheap (generally only a couple of instructions); y= ou > can only detect the overhead in benchmarks. The odds that it would matter= to > a program is minimal (and the program is a lot safer for its enclusion). > Overhead from exceptions and potentially finalizations are several orders= of > magnitude larger, and matter a lot more. That's my point. Range checking may be an acceptable cost, and is done so for safety. C++ isn't willing to pay that cost by default. It's a trade off safety vs. speed. That's all. You seem to think I am arguing against the checks, or against Ada. I'm not. Just pointing out the differences. > > Premature optimization (which includes worrying about overhead without > determining that it is significant) is the root of much evil. > I know that, and it's beside the point. I was just trying to explain (and obviously poorly) the philosophical differences that (in my opinion) the two languages take. It nothing do with slighting each one. I use and like both. Ada has an emphasis on safety, C++ on speed. REH