comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Advantages
Date: Sun, 04 Jul 2004 14:11:28 -0400
Date: 2004-07-04T14:11:28-04:00	[thread overview]
Message-ID: <186dnYWPYr_N1XXdRVn-uA@comcast.com> (raw)
In-Reply-To: <mailman.170.1088402869.391.comp.lang.ada@ada-france.org>

Andrew Carroll wrote:

> VERY NICE!!  I'm guessing that Ada does this type of checking in
> general and not just for the concurrency model?

The original intent of the Ada elaboration model was to eliminate access
before elaboration (ABE) errors.  The basic concept is that their must 
be a linear elaboration order for a program that does not involve any 
subprogram being called or object being referenced before its 
declaration has been elaborated.  This means you can't reference a 
variable before it has been initialized, and so on.

In the case of protected objects, what I was saying was that the 
existance of this elaboration order means that you can "take advantage" 
of the fact that it exists to prevent deadlock.

As other posts in this thread show, you can still "brute force" a 
deadlock in Ada.  (The simplest way is to have a task call one of its 
own entries.)  But if you create a program where you accidently call a 
procedure or function that calls an entry of a protected object, the 
compiler can/should warn you.  Calling functions or procedures of 
protected objects that occur earlier in the elaboration chain won't 
cause a deadlock, because of the enforced partial ordering.

Of course, also as the discussion showed, you can "get around" this to 
create a deadlock in several ways.  But you can also make the 
elaboration ordering a part of your design, and require messinger tasks 
when a violation could occur.  Again, with tasks you have to design them 
so that they don't deadlock.  But if you get the design right in the 
implementation of the task, calling that task won't create deadlocks. 
Again due to the elaboration heirarchy.

> I think you have shown me another side of Ada.  Or at least given me
> a glimpse of another side of Ada.  It helps so much to have an
> example!!! Do the new "limited with" and "synchronized" keywords
> discussed for Ada200Y affect the information you have provided?

You are asking me to predict the future. ;-) The intent is that the 
changes in Ada 0Y will not break any of these fundamental concepts.  But 
are there design errors in the current versions of these proposals? 
Probably.  That is why there is so much review involved before the new 
version of Ada becomes official.

-- 

                                           Robert I. Eachus

"The flames kindled on the Fourth of July, 1776, have spread over too
much of the globe to be extinguished by the feeble engines of despotism;
on the contrary, they will consume these engines and all who work them."
-- Thomas Jefferson, 1821




  parent reply	other threads:[~2004-07-04 18:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040628005515.0A1E74C4160@lovelace.ada-france.org>
2004-06-28  6:23 ` Advantages Andrew Carroll
2004-06-28 14:44   ` Advantages Jacob Sparre Andersen
2004-07-04 18:11   ` Robert I. Eachus [this message]
2004-06-28  9:52 Advantages Lionel.DRAGHI
  -- strict thread matches above, loose matches on Subject: below --
2004-06-27  7:04 Advantages Andrew Carroll
2004-06-27 15:16 ` Advantages Nick Roberts
2004-06-27 21:22   ` Advantages Pascal Obry
2004-06-28  0:51   ` Advantages Robert I. Eachus
2004-06-28  1:59     ` Advantages Brian May
2004-06-29  0:24       ` Advantages Randy Brukardt
2004-06-29  3:32         ` Advantages Hyman Rosen
2004-06-29 18:41           ` Advantages Randy Brukardt
2004-07-02  0:49             ` Advantages Brian May
2004-07-02  1:31               ` Advantages Jeffrey Carter
2004-07-02  9:13               ` Advantages Dmitry A. Kazakov
2004-07-02 12:27               ` Advantages Marin David Condic
2004-07-04 17:42       ` Advantages Robert I. Eachus
2004-06-28 12:08   ` Advantages Marin David Condic
2004-06-27 18:32 ` Advantages Jim Rogers
2004-06-26  6:28 Advantages Andrew Carroll
2004-06-25 19:41 Advantages Andrew Carroll
     [not found] <20040624170516.B4DFC4C4110@lovelace.ada-france.org>
2004-06-25 12:24 ` Advantages Andrew Carroll
2004-06-25 12:22   ` Advantages Peter Amey
2004-06-26 20:43   ` Advantages Marin David Condic
replies disabled

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