comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Ravenscar-compliant bounded buffer
Date: Wed, 5 Sep 2007 21:04:58 -0700
Date: 2007-09-05T21:04:58-07:00	[thread overview]
Message-ID: <KpmdnU93T8P24ULbnZ2dnUVZ_ualnZ2d@comcast.com> (raw)
In-Reply-To: 1188977891.197536.21660@r29g2000hsg.googlegroups.com

"Maciej Sobczak" <see.my.homepage@gmail.com> wrote in message 
news:1188977891.197536.21660@r29g2000hsg.googlegroups.com...
> On 5 Wrz, 05:00, "Steve" <nospam_steve...@comcast.net> 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.
>

Very interesting.  A profile that promotes obscurity.

> 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.
>

Given the restriction, I found your example easy to follow.  I don't know 
where to find the Ravenscar document for comparison.

> 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.
>

Ada 83 was restrictive in ways that were found to be overly restrictive for 
practical application.  Some of these retrictions were relaxed with Ada 95. 
Perhaps the next round of Ravenscar will do the same.

While I am not expert on protected types, it is my experience that the 
predictability of a protected type has more to do with the complexity than 
the number of entries.  Of course that doesn't matter if you must follow 
Ravenscar.

Regards,
Steve

> Still, since I'm new to Ada, I welcome any comment that can help me
> understand it better.
>
> --
> Maciej Sobczak
> http://www.msobczak.com/
> 





  reply	other threads:[~2007-09-06  4:04 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 13:53 Ravenscar-compliant bounded buffer Maciej Sobczak
2007-09-05  3:00 ` Steve
2007-09-05  7:38   ` Maciej Sobczak
2007-09-06  4:04     ` Steve [this message]
2007-09-06 14:06       ` Robert A Duff
2007-09-06 15:36         ` Dmitry A. Kazakov
2007-09-07  2:36           ` Robert A Duff
2007-09-06 21:13         ` Maciej Sobczak
2007-09-07  2:41           ` Robert A Duff
2007-09-07 11:56           ` anon
2007-09-07 19:44             ` Maciej Sobczak
2007-09-08  0:16               ` anon
2007-09-08  1:19                 ` Larry Kilgallen
2007-09-08  5:13                   ` anon
2007-09-08 22:06                     ` Larry Kilgallen
2007-09-09  2:17                       ` anon
2007-09-09 12:07                         ` Larry Kilgallen
2007-09-09 13:10                         ` Markus E L
2007-09-11  2:44                     ` Randy Brukardt
2007-09-08 11:50                 ` Niklas Holsti
2007-09-08 12:01                   ` Pascal Obry
2007-09-08 17:13                     ` anon
2007-09-08 17:11                   ` anon
2007-09-08 19:14                     ` Markus E L
2007-09-09 14:54                       ` anon
2007-09-09 16:01                         ` Markus E L
2007-09-09 10:38                     ` Gautier
2007-09-09 11:41                       ` anon
2007-09-09 13:19                         ` Markus E L
2007-09-09 13:52                         ` Pascal Obry
2007-09-09 15:22                           ` anon
2007-09-09 16:03                             ` Markus E L
2007-09-10  0:05                               ` Larry Kilgallen
2007-09-10  3:10                                 ` Markus E L
2007-09-09 16:05                             ` Markus E L
2007-09-09 18:40                             ` Ed Falis
2007-09-09 19:11                               ` Markus E L
2007-09-09 10:57                     ` Gautier
2007-09-09 14:49                       ` anon
2007-09-09 15:08                         ` Pascal Obry
2007-09-09 15:38                         ` Markus E L
2007-09-09 19:12                     ` Niklas Holsti
2007-09-09 19:28                       ` Ed Falis
2007-09-10 12:51                   ` Colin Paul Gloster
2007-09-07  1:38         ` Steve
2007-09-07  2:47           ` Robert A Duff
2007-09-05  7:46   ` Dmitry A. Kazakov
2007-09-05  8:17     ` brodax
2007-09-05  8:30     ` Jean-Pierre Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox