comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: renames and access
Date: Fri, 13 Feb 2004 15:33:08 -0500
Date: 2004-02-13T15:33:08-05:00	[thread overview]
Message-ID: <PsednWSDhfsYqbDdRVn_iw@comcast.com> (raw)
In-Reply-To: <pan.2004.02.12.18.36.09.538296@virgilio.it>

Francesco Bochicchio wrote:

> I thought of that:
> 
> 1. It adds a function call overhead for each time one of the variables is
>    accessed ( and it happens a lot )

It does NOT add function call overhead, especially if you in-line the 
function.  What it does do is insist that the names be re-evaluated when 
used.  To the extent that this is what you wish, you get what you asked 
for.  If you can use a grosser level of granularity, you can put some 
sections of code in a handler that just reinvokes the code, and have the 
code use local renames.

> 2. It only solves variable reading. I don't see any equivalent way to
> assign values to the variables.

Huh?  A function that returns an access type can appear as part of a 
name on the left hand side of an assignment statement.  So if you have a 
function A that returns a pointer to an object with components C,D and E 
of type Integer,

A.E := 3;

works just fine.

What you might have to do is a global replace on the code to change 
current instances of E to A.E assuming A and B are record containing the 
data that you want replicated.  Notice that a renaming of A.E as E will 
"lock in" the current dereference.  You can combine it with what I said 
above about granularity, and if the retries occur at a high enough level 
you won't have to change much.  (All you have to do is put all renames 
inside the code that is retried after a failure.)

There is no easy way to do the analysis needed to decide how far out you 
can move the retries in various areas of the code.  But once you do 
that, renamings should work fine.

-- 
                                           Robert I. Eachus

"The war on terror is a different kind of war, waged capture by capture, 
cell by cell, and victory by victory. Our security is assured by our 
perseverance and by our sure belief in the success of liberty." -- 
George W. Bush




  parent reply	other threads:[~2004-02-13 20:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-11 19:15 renames and access Francesco Bochicchio
2004-02-11 22:09 ` Randy Brukardt
2004-02-12  0:02 ` Robert A Duff
2004-02-12 18:36   ` Francesco Bochicchio
2004-02-13  8:30     ` Martin Dowie
2004-02-13 20:33     ` Robert I. Eachus [this message]
2004-02-12  2:32 ` Stephen Leake
2004-02-12 18:30   ` Francesco Bochicchio
2004-02-13 19:01     ` Georg Bauhaus
replies disabled

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