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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e44790cdcea9da82 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!fr.ip.ndsoftware.net!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Problem with -gnatt Date: Wed, 20 Oct 2004 09:22:28 -0400 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: melchior.cuivre.fr.eu.org 1098278590 73181 212.85.156.195 (20 Oct 2004 13:23:10 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 20 Oct 2004 13:23:10 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Authentication-Warning: fajita.toad.net: apache set sender to stephen_leake@acm.org using -f User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:5517 Date: 2004-10-20T09:22:28-04:00 Pascal Obry writes: > Stephen Leake writes: > > > > Note that protected operations should only execute "for a short time." > > > > I wish Robert Dewar were here. I suspect he would say something like > > "Rubbish!". > > Well I don't know what Robert would say, but for sure you can't use IO inside > a protected object routine. Hmm. If by "IO" you mean "an operation that does input output to some hardware", then that's not true; the LRM says nothing about hardware. And a protected type is a good way to serialize access to hardware. On the other hand, if by "IO" you mean "a potentially blocking operation that does input output to some hardware", then true, the LRM say "you can't do blocking operations in protected operations". However, Robert Dewar has called that requirement "rubish" as well, since it is impossible to enforce in general. Calling Ada.Text_IO.Put_Line from a protected object "works" in some implmentations (GNAT on MS Windows), not in others (GNAT on LynxOS). It is _not_ portable, since it is forbidden by the language, since Ada.Text_IO.Put_Line is _defined_ _by the language_ to be a "potentially blocking operation". > > "a short time" is not definable in any meaningful _standard_ way. > > It is _totally_ up to the user to decide what that means. > > Ok. > > > If your application can afford to wait an hour for a protected object, > > then an hour is "a short time". > > An hour without a single IO ? An hour without a blocking operation. I'm computing PI, or filtering for ET messages, or something. And I'm on a really slow machine. Ada must work in a _very_ wide range of circumstances! > So "for a short time" is certainly something (even if not formal) we > have to keep in mind. No, "blocking operations" is what we have to keep in mind. -- -- Stephe ___________________________________________________________ This mail sent using ToadMail -- Web based e-mail @ ToadNet