Re: Distributed Ada, robustness etc.



On Tue, 23 May 2006 12:14:05 +0000, Dr. Adrian Wrigley wrote:

Up until now, I have been using fairly elementary Annex E features
with GNAT/GLADE on Linux.
<snip>

Hmm. Seems to have gone quiet round here!

OK. I've prototyped a system based on LRM E.4.2 (p. 412), where a
Remote_Call_Interface unit registers servers as they are instantiated.

This will work nicely, except for the single point of failure
issue resulting from having RCI units, and the following nuisance:

EITHER
every subprogram declaration using the remote despatching type
has to refer to it as "access Tape" (or whatever the type is called),

procedure Rewind (T : access Tape) is abstract; -- need to add "access"
....
TapeAccess := Find ("NINE-TRACK");
....
Rewind (TapeAccess);

Or

every despatching call needs to dereference an access variable
(so calls become something like "Tapes.Rewind (TapeAccess.all);")

procedure Rewind (T : Tape) is abstract;
....
TapeAccess := Find ("NINE-TRACK");
....
Rewind (TapeAccess.all); -- Need to add ".all" for every call!

I'd rather not change all my code to say "access" or "all" every
time I define or use one of these calls (lazy). The only solution
I have come up with to avoid modifying the existing code to have
"all" with every call is to define a corresponding set of subprograms
which take the access values as parameters, and call the underlying
(remote) despatching interface by dereferencing it in the body.

So the code would become:

procedure Rewind (T : Tape) is abstract; -- unchanged code
procedure Rewind (T : access Tape) is begin Rewind (T.all); end Rewind;
....
TapeAccess := Find ("NINE-TRACK");
....
Rewind (TapeAccess); -- unchanged code

Am I missing a better, more obvious solution?

(interestingly, the remote despatching call may fail from
communications errors or other failure. The corresponding
non-remote call can handle the exception by using the "Find"
to get another server to call instead, or take other
recovery actions. Perhaps this is the way to go...)

I'm still thinking about eliminating the RCI failure point.

I'm wondering whether Annex E has ever been used as a basis
for a big commercial project...
--
Adrian


.



Relevant Pages

  • Re: Distributed Ada, robustness etc.
    ... procedure Rewind (T: access Tape) is begin Rewind; end Rewind; ... Then it does not work properly when you have a types hierarchy ... one should get a big project for Ada. ...
    (comp.lang.ada)
  • [PATCH 5/6] mremap check map_count
    ... mremap's move_vma should think ahead to lessen the chance of failure ... during its rewind on failure: running out of memory always possible, ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)