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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3a3dffa82925efee X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 04 Jul 2004 13:11:28 -0500 Date: Sun, 04 Jul 2004 14:11:28 -0400 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Advantages References: <20040628005515.0A1E74C4160@lovelace.ada-france.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <186dnYWPYr_N1XXdRVn-uA@comcast.com> NNTP-Posting-Host: 24.147.90.114 X-Trace: sv3-eyHq21KGY2db5EMK8VTOH1IidzXUvk53Q81cLux7W8KmTqJUA58B1eSonYxrR5Lche2x/JIDVLdFq9m!y3uO6rc+mvoXhEY9GHqQ24r+Ua5OQ8ryKYn+VttJo/vBvRgEN6pG7HMDCOyTXg== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: g2news1.google.com comp.lang.ada:2062 Date: 2004-07-04T14:11:28-04:00 List-Id: 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