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: Tue, 29 Jun 2004 13:41:19 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <2k86nbF18idtrU1@uni-berlin.de> <3p5Ec.13759$Av3.4246@nwrdny01.gnilink.net> Subject: Re: Advantages Date: Tue, 29 Jun 2004 13:41:43 -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-kJzVSTueSjdpzZQFFnLE7mScrFdY4KiZwsIqLfYl/SXNMH4B6I9l1AhYPR0BghlHGhGYf1ybbFmyDA0!DDjeEAJbamGsl0L7wdpUDXeJaBdBtvbRUXsb/51FW/8RV6K+UwHSBQpN7Vcik0E21u9UPiDdUm9c 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:2002 Date: 2004-06-29T13:41:43-05:00 List-Id: "Hyman Rosen" wrote in message news:3p5Ec.13759$Av3.4246@nwrdny01.gnilink.net... > Randy Brukardt wrote: > > 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". > > > > 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... > > If I'm not mistaken, normal Ada I/O is potentially blocking and is > therefore technically not allowed in protected actions. I believe > ACT's customers found this to be too restrictive, and that's why > GNAT doesn't prevent potentially blocking actions from being called. > I seem to recall threads on this subject back when Dewar was still > here. That's correct. And it makes sense to allow I/O, as many implementation don't in fact do anything blocking. But I would expect that the implementation would treat things that are *known* to be blocking (like a delay statement) differently - there can be no legitimate reason for doing that. In a ceiling locking implementation, blocking would effectively break the locking (as there is no explicit lock), meaning that the entire abstraction was completely broken. Given that Ada is usually about safety, allowing that sort of result just doesn't make sense. (Janus/Ada checks when blocking task supervisor calls are made, so I/O, for example, isn't necessarily restricted.) Randy.