comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Streams and Concurrency
Date: 1998/12/30
Date: 1998-12-30T00:00:00+00:00	[thread overview]
Message-ID: <76dgdl$qle$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 76c3tv$acs@bgtnsc02.worldnet.att.net

In article <76c3tv$acs@bgtnsc02.worldnet.att.net>,
  "James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:
> would be the typical Ada 83 approach.  The more modern, and
> more efficient approach in Ada 95 is to have encapsulate the stream
> in a protected object.  All access will be correctly and effectively
> controlled by the protected object mechanism.

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. Making the stream a proteced object does
nothing for me here.

The design of streams makes this problem basicly intractable at any level but
the client level. It can't be done just by adding code to the stream
implementation.

The sad thing is that this isn't even the biggest problem. The fun *really*
starts when you want to read the data back in safely without blocking...

--
T.E.D.

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




  parent 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   ` 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   ` 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         ` 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-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-30  0:00 ` dennison [this message]
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