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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e0e1d3b3f7c994b8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Robert Dewar's great article about the Strengths of Ada over other langauges in multiprocessing! Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <13t4b2kkjem20f3@corp.supernews.com> <89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com> <47D39DC8.20002@obry.net> Date: Sun, 9 Mar 2008 14:37:53 +0100 Message-ID: <1lbnckly14ak1$.1toakcw8jw12$.dlg@40tude.net> NNTP-Posting-Date: 09 Mar 2008 14:37:56 CET NNTP-Posting-Host: deeaba47.newsspool3.arcor-online.net X-Trace: DXC=dimo3>nDo07n`gW2MTm]<3McF=Q^Z^V384Fo<]lROoR14nDHegD_]R5U9CEhnQD:Z>DNcfSJ;bb[5IRnRBaCdZ@;B=g0V_` On Sun, 9 Mar 2008 05:40:53 -0700 (PDT), Vadim Godunko wrote: > On Mar 9, 11:20 am, Pascal Obry wrote: >> >> I prefer using Ada, even losing 10% performance initially. > > I usually have 4+ times penalty for Ada program with controlled object > for memory allocation/deallocation control and protected objects for > thread safe operations in comparison with equivalent C++ program. :-( [...] Controlled object's performance is of course an issue in Ada, when you need fast initialization/finalization. It should be redesigned, not controlled types, but others, by-value, types in order to support initialization/finalization and classes. It is unclear in which the context you are using protected objects. I don't see why a protected object should be slower than, say, critical section + operation. I don't see protected actions in your code. You probably use them for locking somewhere inside. This would be an abstraction inversion, bad design. (However, one could address this to another Ada problem: protected objects aren't tagged/controlled.) > for J in 1 .. 1_000 loop > if J mod 2 = 1 then > B := A; Is this a deep copy? What is controlled, array, elements, both? What is the locking policy, per container, per element, both? As for multi-cores, I guess that protected object would not be a good concurrency primitive for such architectures. In a long term perspective, we could experience the pendulum swinging back to tasks. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de