comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: Streams and Concurrency
Date: 1998/12/31
Date: 1998-12-31T00:00:00+00:00	[thread overview]
Message-ID: <76g9ds$ura$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 76fe92$46c$1@platane.wanadoo.fr

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]

In article <76fe92$46c$1@platane.wanadoo.fr>,
  "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr> wrote:
>
> James S. Rogers a �crit dans le message
> <76dn7b$a35@bgtnsc03.worldnet.att.net>...
> >Following is a modest example of what I mean about
> >encapsulating a stream in a protected object.
> >[snip]
>
> Unfortunately, all IO operations are potentially
> blocking, and therefore not allowed from within a
> protected operation.
> To get the effect of mutual exclusion for procedures
> requiring potentially blocking operations, have a look at
> package Protection available from Adalog's components
> page (http://perso.wanadoo.fr/adalog/compo2.htm)

By the way, JPR here seems to be making the mistake of
assuming that stream = stream_io, a common confusion. The
original question here related to a particular
implementation of streams that you have not seen, and you
do not know if it does any potentially blocking operations.

Yes, it had to do with file logging, but that does not
mean that it does I/O. For example, a perfectly reasonable
organization is to have a stream implementation that fills
a buffer that is part of a protected type, and a consumer
task that empties the buffer and does I/O on it. This
organization violates absolutely nothing with regards to
doing potentially blocking operations.

In Ada 95, if you are following the official design, every
single abstraction must be labeled in its spec as to
whether it does or does not do PB operations, so that you
know if it can be called from a protected operation. Yes,
that's frightful from an abstractrion point of view, but
that's the way the language is, due to the excessive
influence of one particular efficiency-obsessed specific
design for possible implementation of protected types.

A given implementation of streams (for logging or any
other purpose) may or may not do PB operations, and that
must be part of its spec.

As I commented before, we have essentially extended the
language for GNAT by defining that the implementation
dependent behavior for PB operations, i.e. the behavior
of the compiler for this bounded error, is NOT to reject
the PB operation, but to go ahead and do it, with the
expected consequences.

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1998-12-31  0:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-30  0:00 Streams and Concurrency James S. Rogers
1998-12-29  0:00 ` David Botton
1998-12-30  0:00   ` James S. Rogers
1998-12-30  0:00     ` dennison
1998-12-30  0:00       ` James S. Rogers
1999-01-04  0:00       ` Robert I. Eachus
1998-12-31  0:00     ` Jean-Pierre Rosen
1998-12-31  0:00       ` dewar [this message]
1998-12-31  0:00         ` dennison
1999-01-04  0:00         ` Jean-Pierre Rosen
1999-01-04  0:00           ` robert_dewar
1998-12-31  0:00       ` dewar
1998-12-31  0:00         ` Ada-G, was " Tom Moran
1999-01-01  0:00           ` dewar
1999-01-01  0:00             ` Larry Kilgallen
1999-01-01  0:00           ` Brian Rogoff
1999-01-04  0:00             ` Robert I. Eachus
1999-01-08  0:00               ` Mats Weber
1999-01-08  0:00                 ` Robert I. Eachus
1999-01-08  0:00         ` Mats Weber
1999-01-08  0:00           ` Tucker Taft
1998-12-30  0:00   ` dennison
1998-12-30  0:00     ` Tucker Taft
1998-12-30  0:00       ` Robert I. Eachus
1998-12-30  0:00         ` Tucker Taft
1998-12-31  0:00         ` dennison
1998-12-31  0:00           ` robert_dewar
1998-12-31  0:00             ` dennison
1999-01-01  0:00               ` robert_dewar
1999-01-04  0:00           ` Robert I. Eachus
1998-12-30  0:00       ` dennison
1998-12-31  0:00         ` robert_dewar
1998-12-30  0:00 ` dennison
1998-12-30  0:00   ` Robert I. Eachus
1999-01-11  0:00   ` Bulk synchronous model for IO (was Re: Streams and Concurrency) Kevin Rigotti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox