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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d495ab2e69ad1962 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!r29g2000hsg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ravenscar-compliant bounded buffer Date: Wed, 05 Sep 2007 00:38:11 -0700 Organization: http://groups.google.com Message-ID: <1188977891.197536.21660@r29g2000hsg.googlegroups.com> References: <1188914005.607732.277400@57g2000hsv.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1188977891 3759 127.0.0.1 (5 Sep 2007 07:38:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 5 Sep 2007 07:38:11 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070724 Red Hat/1.5.0.12-0.3.slc3 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r29g2000hsg.googlegroups.com; posting-host=137.138.37.241; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:1745 Date: 2007-09-05T00:38:11-07:00 List-Id: On 5 Wrz, 05:00, "Steve" wrote: > While I don't know much about the Ravenscar profile :-) In particular, one of the constituents of the Ravenscar profile is this: pragma Restrictions (Max_Protected_Entries => 1); which explains the whole issue. Bounded buffer is obvious to implement without the above restriction and I completely agree that using two separate protected objects is an "abstraction inversion". The problem is that to be compliant with the Ravenscar profile a protected type can have *at most one entry* - the rest is really a question about the "correct hack" that has to be applied for typical shared resource patterns. I argue that my hack is better (more readable and easier to analyze) than the original hack presented in example 12 of the Ravenscar document. I will not argue that any of these hacks is better than the straightforward implementation with two entries, but I can accept the statement that this is the price for having a uniform convention that pays off in general, although not necessarily in this particular case. Still, since I'm new to Ada, I welcome any comment that can help me understand it better. -- Maciej Sobczak http://www.msobczak.com/