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: <76e2rl$a4b$1@nnrp1.dejanews.com> (raw)
In-Reply-To: F4sFr8.HHG.0.-s@inmet.camb.inmet.com

In article <F4sFr8.HHG.0.-s@inmet.camb.inmet.com>,
  stt@houdini.camb.inmet.com (Tucker Taft) wrote:
> It seems clear that the stream attributes do not directly support the
> logging from multiple tasks, with interleaving occurring only
> between "top-level" objects, as desired by this application.
> Furthermore, they don't support reading without waiting.
>
> However, it should be simple enough to build a generic package
> which provides the desired functionality.
>
> Each current "top-level" use of a stream attribute in the application
> would be changed to be a call on a "read/write" or "input/output" routine of
an
> appropriate instance of this generic package.  Such a routine would
> acquire a lock on the stream, invoke the corresponding stream attribute,
> and release the lock.

Ahhh. Now that might do the trick. Thanks a lot! It hadn't occurred to me
that generics can call the attributes too. Of course if your clients would
prefer the attribute interface this is a problem. But I don't see that being
too much of an issue.

> Furthermore, to support non-blocking read, you would need to add some
> kind of marker into the stream itself, I suspect, to be placed between
> "top-level" objects in the stream.  Then, when you call the non-blocking
> "read" or "input" routine of the instance of this generic package,

Yes, exactly. The problem is there's no way for the reader to know where
"between" is without first trying to read the entire object. Even within the
same data structure, the size could change depending on the value of a tag or
variant (or some other user-defined critera). The only way I could see to do
it is to have the writer put the length of the object in the stream *at the
front* of the object *after* the object is written. Doing this requires some
kind of direct access into the stream, and a way of blocking reads until the
whole object is written. Otherwise the reader could read that size data out
of the stream before the writer has a chance to fill it in.

My problem with doing the above was that it also requires the whole-object
locking of the stream (which you  have just explained one way to handle).

--
T.E.D.

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




  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         ` 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
1998-12-30  0:00     ` Tucker Taft
1998-12-30  0:00       ` dennison [this message]
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
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