comp.lang.ada
 help / color / mirror / Atom feed
From: Jim Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Complexity of protected objects
Date: Mon, 25 Feb 2002 17:35:45 GMT
Date: 2002-02-25T17:35:45+00:00	[thread overview]
Message-ID: <3C7A75F2.30503@worldnet.att.net> (raw)
In-Reply-To: a5dont$dh9$1@helle.btinternet.com

Using a protected object to read and write files is a clear
violation of the intention and recommendations for proctected
objects. Protected objects should be non-blocking. I/O is
always potentially blocking.

You even have some potential blocking issues when storing an
AVL tree. If you dynamically allocate your AVL tree nodes you
have the possibility of running out of memory. This will either
result in a blocking situation, or a potential loss of data
in the AVL tree.

I would be inclined to use a simple protected buffer object to
communicate with one or more tasks for the reading and writing,
and another task to store the AVL tree. Protected operations allow
you to design a degree of asynchronisity into your system. They are
not expected to replace tasks for all uses.

Jim Rogers

tony gair wrote:

> I'm considering using a protected object to store an AVL tree and also to
> write and read files,
> normally I would have used tasks for this, but I wish to experiment
> slightly.
> 
> J Barnes recommends that  protected objects be as small as possible, so
> being a little
> bloody minded I want to see what the limits are for protected objects ,
> I would be very interested to see unusual protected objects people have
> created, which
> do things protected objects were not designed for (is this an oxymoron?).
> 
> 
> 
> 




  parent reply	other threads:[~2002-02-25 17:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-25 16:28 Complexity of protected objects tony gair
2002-02-25 16:45 ` Marin David Condic
2002-03-03  1:11   ` Robert Dewar
2002-03-03  4:13     ` Dale Stanbrough
2002-03-03 19:50       ` Robert Dewar
2002-02-25 17:35 ` Jim Rogers [this message]
2002-02-28 22:09   ` Nick Roberts
2002-02-28 23:32     ` Dale Stanbrough
2002-03-01  5:45       ` Jim Rogers
2002-03-03  0:59       ` Robert Dewar
2002-03-01 17:42     ` Jeffrey Carter
2002-03-03  1:06       ` Robert Dewar
2002-03-03  6:53         ` Jeffrey Carter
2002-03-03 19:36           ` Robert Dewar
2002-03-04 20:04             ` Jeffrey Carter
2002-03-03  0:54     ` Robert Dewar
2002-03-03  0:32   ` Robert Dewar
2002-02-25 22:01 ` Ted Dennison
2002-03-03  1:08   ` Robert Dewar
2002-03-04  9:33     ` Dmitry A. Kazakov
2002-03-04 16:44       ` Ted 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