From: mackey@scs.fiu.edu
Subject: Re: A Modest Exercise in Ada Program Portability
Date: 27 Nov 90 23:11:36 GMT [thread overview]
Message-ID: <1829@kluge.fiu.edu> (raw)
In-Reply-To: 2373@sparko.gwu.edu
In article <2373@sparko.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
>Here is an exercise in Ada program portability. It is an implementation
>of the famous Dining Philosophers problem, first posed by E. Dijkstra in
>...
>This exercise has been successfully compiled and executed, without needing to
>change any source code, under the following compilers:
>IBM-PC Meridian AdaZ
>IBM-PC AETech IntegrAda (same compiler as Janus Ada)
>HP9000/300 Verdix VADS (HP/UX)
>HP9000/800 Irvine Compiler Corporation ICC Ada (HP/UX)
>Sun-3 Verdix VADS (SunOS 4.0)
>Sun-3 TeleSoft Telegen2 (SunOS 4.0)
>Sun-3 Meridian AdaVantage (SunOS 4.0)
>...
>Please try this on your favorite compiler and let me know if your
>experience differs from mine.
........
The code also runs (almost) unchanged on VAX/VMS with the DEC Ada
compiler. The only needed change was a pragma at the front of
``diners.ada'', changing:
WITH Room;
PROCEDURE Diners IS
...
into:
WITH Room;
with Control_C_Interception; -- Ensure ^Y or ^C kills process.
pragma elaborate( Control_C_Interception );
PROCEDURE Diners IS
...
Actually, the program does work without this modification, but is slow
to stop when Ctrl/C is hit. With the pragma, a Ctrl/C gets attention
from the runtime routines which accept an exit/continue/... command.
Without it, a task which is sleeping in a delay statement only stops
when it wakes up rather than immediately.
........
The code was written for a vt100 terminal not a shelltool on the
suns, but works fine in a shelltool with the change of:
put( ESC & "[2J" );
to:
put( FF );
in the vtbody.ada package body. It also runs on a sun4 under
Telesoft Telegen2. No change was needed to run in a te100tool window
either locally on a Sun3 or on a Sun3 te100tool rlogin'd to a Sun4.
.
next prev parent reply other threads:[~1990-11-27 23:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1990-11-26 17:05 A Modest Exercise in Ada Program Portability Michael Feldman
1990-11-27 23:11 ` mackey [this message]
1990-11-28 22:01 ` Vladimir G. Ivanovic
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox