comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Streams and Concurrency
Date: 1998/12/30
Date: 1998-12-30T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.98Dec30170146@spectre.mitre.org> (raw)
In-Reply-To: 76dgdl$qle$1@nnrp1.dejanews.com

In article <76dgdl$qle$1@nnrp1.dejanews.com> dennison@telepath.com writes:

 > That's the first thing I thought of too. This solution protects the
 > stream itself from corruption just fine. The problem is that it
 > provides absolutely no protection for the *data* in the stream. If
 > I do a 'Write of a record, that gets translated into *several*
 > "Write" calls to the stream, not just one. There's nothing stopping
 > another task from making a call to the stream's Write subprogram in
 > the middle of my record's 'Write. There's nothing stopping the
 > stream service task from calling the stream's Read procedure in the
 > middle of my 'Write either...

    This is wrong.  The encapsulation as illustrated by Jim Rogers
does it right.  The protected object doesn't wrap every call to 'Read
or 'Write, just the highest level calls.  Even if one of those calls
causes many lower level calls all happen inside a single call to the
protected object.

 > Making the stream a proteced object does nothing for me here.
    
    This is trying to solve the wrong problem.  Putting calls to the
protected action inside 'Read or 'Write can't work right.  You have to
have a single protected object which encapsulates the particular
stream.  If you need to read and write different types of values to
the same stream, you either have to derive them all from a single
tagged type, or have several sets of read and write entries to the
protected type, one set for each type of object.
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




  reply	other threads:[~1998-12-30  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
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           ` 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-01  0:00           ` dewar
1999-01-01  0:00             ` Larry Kilgallen
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       ` dennison
1998-12-31  0:00         ` robert_dewar
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-30  0:00   ` Robert I. Eachus [this message]
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