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: 103376,e0e1d3b3f7c994b8 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.germany.com!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Robert Dewar's great article about the Strengths of Ada over other langauges in multiprocessing! Date: Mon, 10 Mar 2008 15:51:40 -0500 Organization: Jacob's private Usenet server Message-ID: References: <13t4b2kkjem20f3@corp.supernews.com> <89af8399-94fb-42b3-909d-edf3c98d32e5@n75g2000hsh.googlegroups.com> <47D39DC8.20002@obry.net> <1lbnckly14ak1$.1toakcw8jw12$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1205182365 29634 69.95.181.76 (10 Mar 2008 20:52:45 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 10 Mar 2008 20:52:45 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:20279 Date: 2008-03-10T15:51:40-05:00 List-Id: "Vadim Godunko" wrote in message news:ec684efe-61a6-4463-bd43-fb5895e868bc@x30g2000hsd.googlegroups.com... > On Mar 9, 4:37 pm, "Dmitry A. Kazakov" > wrote: > > > > 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 have attach all source code. Protected object used for atomic > reference counting (The design may be looks strange, I just have plans > to replace protected object by the inline assembler code). If you need an atomic component, why didn't you just declare it as such and let the compiler handle the mess? (Yes, an implementation is allowed to reject pragma Atomic if it can't handle such, but that should always be OK for an integer counter.) A protected object is going to be much heavier than Atomic (which just uses the hardware support directly). ... type Private_Data is record --Counter : aliased League.Internals.Atomics.Counter; Counter : Natural := 0; pragma Atomic (Counter); String : Utf16_String_Access; Last : Natural := 0; Length : Natural := 0; end record; (No, I haven't tried this in your program.) Randy.