comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Stream venting (long)
Date: 1998/12/30
Date: 1998-12-30T00:00:00+00:00	[thread overview]
Message-ID: <76de7d$opb$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 76baib$4ne$1@nnrp1.dejanews.com

In article <76baib$4ne$1@nnrp1.dejanews.com>,
  robert_dewar@my-dejanews.com wrote:
> In article <76aor7$l4q$1@nnrp1.dejanews.com>,
>   dennison@telepath.com wrote:
> > The problem is when to release the lock. You can't
> > acquire and release it after every call to the stream's
> > Read or Write procedures, or you get interleaved data.
> > You'd have to do it *manually* before the client's first
> > top level 'Write call and after their last. That means
> > the client has to do
> > it. Yuk.
>
> I already gave the (perfectly trivial) solution for this
> problem. Associate a lock with the stream. When a stream
> routine is called, claim the lock IF IT IS NOT ALREADY
> CLAIMED by you! On completion, release the lock IF YOU
> CLAIMED it on entry. This should be perfectly simple to
> program, and completely solves your problem.

Hmm. It appears you think my problem is with algorithmicly handling the
clients locking when locking is happening interally already. That's not the
case; my problem is making the clients do their own pre- and postprocessing.
That's a crappy interface. My code should be handling messy details like that
for them (not so incidently, removing one possible source for errors). They
should just be able to do a 'Write on their data structure and be done with
it.

--
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: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-28  0:00 Stream venting (long) dennison
1998-12-29  0:00 ` robert_dewar
1998-12-29  0:00   ` dennison
1998-12-29  0:00     ` robert_dewar
1998-12-30  0:00       ` dennison [this message]
1998-12-30  0:00         ` robert_dewar
1998-12-30  0:00           ` dennison
1998-12-31  0:00             ` robert_dewar
1998-12-31  0:00               ` LeakyStain
1998-12-31  0:00                 ` dewar
1998-12-31  0:00                   ` dennison
replies disabled

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