comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Advantages
Date: Tue, 29 Jun 2004 13:41:43 -0500
Date: 2004-06-29T13:41:43-05:00	[thread overview]
Message-ID: <OvqdnfpKdd5NKnzdRVn-hw@megapath.net> (raw)
In-Reply-To: 3p5Ec.13759$Av3.4246@nwrdny01.gnilink.net

"Hyman Rosen" <hyrosen@mail.com> 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.






  reply	other threads:[~2004-06-29 18:41 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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           ` Randy Brukardt [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2004-06-28  9:52 Advantages Lionel.DRAGHI
     [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   ` Advantages Robert I. Eachus
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