comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com (Ted Dennison)
Subject: Re: Complexity of protected objects
Date: 4 Mar 2002 08:44:29 -0800
Date: 2002-03-04T16:44:30+00:00	[thread overview]
Message-ID: <4519e058.0203040844.3146c51b@posting.google.com> (raw)
In-Reply-To: 3c833afb.435853953@News.CIS.DFN.DE

dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) wrote in message news:<3c833afb.435853953@News.CIS.DFN.DE>...
> On 2 Mar 2002 17:08:06 -0800, dewar@gnat.com (Robert Dewar) wrote:
> 
> >dennison@telepath.com (Ted Dennison) wrote in message news:<4519e058.0202251401.27b95bb0@posting.google.com>...
> >> I've generally found that to be good advice. In particular, my PO's
> >> always seem to end up just being specialized semaphores or locks, no
> >> matter how grandiose I start out planning to make them. Things just
> >> work a lot better that way.
> >
> >This is MUCH too restrictive, it is perfectly reasonable
> >to have a large complex data structure as a protected type
> >where the operations on it ensure that consistency is
> >maintained by doing related updates in a non-interruptible
> >manner.
> 
> Theoretically, yes. Practically, I have observed the same effect as
> Ted Dennison pointed out. There are too many reasons why it does not
> work, sigh. One of them is that protected types are not tagged. As a
> result, very often one fails to use PO as the base for that large
> complex data structore. Instead of that one has a PO with an access
> discriminant pointing to some class wide. Slowly but steadily all the
> functionality flows into that tagged type and in the end the PO
> degrades to a simple lock.

I usually end up with a slighly specialized lock or semaphore, but
otherwise this is exactly right. Another prime mover in that direction
is the effect that Dale pointed out elsewhere in this thread:

"Another name for POs/semaphores are "bottlenecks". If you
want to increase the natural parallelism of a program, you
should make the code inside them as short as possible."

Robert seems to read me as saying that this was a law enforced from
above, but I never said that. Its a law in the same way Gravity is a
law. :-)

-- 
T.E.D.
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html



      reply	other threads:[~2002-03-04 16:44 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
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 [this message]
replies disabled

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