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,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.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 28 Jun 2004 19:24:00 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <2k86nbF18idtrU1@uni-berlin.de> Subject: Re: Advantages Date: Mon, 28 Jun 2004 19:24:24 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-pnTSQ8JsPQKiFQ+gQGOOi1MtjNiaKd7PUI+aUBNPbxA+ADa9+O48Slf2DrZZT61gcmX8hyeR3ih8/lP!Hx7vsjIuKZt+L0VoCW9Ne8n61CDAohmTUHVe5sINNJVqdTY1UBYsIeYavydf/5aHoomMKN0kEg8J X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.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:1986 Date: 2004-06-28T19:24:24-05:00 List-Id: "Brian May" wrote in message news:sa47jtse93b.fsf@snoopy.apana.org.au... ... > The implication of what you say is you can't have a deadlock in Ada > across different packages, that will compile, if you use protected > objects in this manner to access variables > > Not true! All your example proves is that GNAT doesn't catch the error in this program. It is a bounded error to use a blocking operation in protected action (see 9.5.1(8-17)). It's defined to either be detected (and raise Program_Error) or otherwise "may result in deadlock". So, if you write code that's defined to deadlock, it isn't particularly surprising that it deadlocks. The reason that this is a bounded error is that it can't in general be detected at compile-time, and there were those that thought the overhead of detecting at run-time was too high. (Janus/Ada always detects it, so your program would just raise Program_Error. But Janus/Ada wasn't designed for hard real-time systems.) I'm pretty sure the intent was that it would be detected if the cost wasn't too severe - there was no intent to allow such things because of the havoc that could occur in the run-time. Since GNAT detected the error at compile-time (thus the warning), there couldn't be any run-time overhead for detecting the error. It should therefore have raised Program_Error (allowing a known deadlock condition seems like a very bad thing). But perhaps there is some customer of ACT's that likes living dangerously? Or, perhaps the case just never came up, because people rarely try to do the obviously bad... Randy.