From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: Impossible problem? A protected buffer to queue objects of a class-wide type
Date: Wed, 11 Apr 2007 16:01:37 +0200
Date: 2007-04-11T16:01:37+02:00 [thread overview]
Message-ID: <8opive.1c3.ln@hunter.axlog.fr> (raw)
In-Reply-To: <461cc46d$1_1@glkas0286.greenlnk.net>
Phil Slater a �crit :
> I've hit a brick wall. Every strategy I try doesn't work.
>
> I need to write a generic package that exports a protected queue type that
> will act as a buffer for objects of a class-wide type.
[...]
Interesting question ;-)
It should be solvable by separating the buffer from the protection, i.e.
keep a protected object just as a lock, and provide operations that take
the lock, do whatever is needed (possibly with several calls), then
release the lock. Don't forget to have a "when others" exception handler
to release the lock in case of an unexpected exception.
This should be quite easy to do if the buffer is the package (i.e. an
abstract state machine). If you need to make the buffer an abstract data
type, you'll have to put the protected object as a component of the record.
--
---------------------------------------------------------
J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr
next prev parent reply other threads:[~2007-04-11 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 11:34 Impossible problem? A protected buffer to queue objects of a class-wide type Phil Slater
2007-04-11 12:25 ` Rob Norris
2007-04-11 13:02 ` Phil Slater
2007-04-12 8:36 ` Stephen Leake
2007-04-11 13:14 ` Dmitry A. Kazakov
2007-04-11 14:01 ` Jean-Pierre Rosen [this message]
2007-04-11 17:18 ` tmoran
2007-04-13 17:02 ` Matthew Heaney
2007-04-13 17:26 ` Matthew Heaney
2007-04-13 17:36 ` Ed Falis
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox