From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,UNRESOLVED_TEMPLATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!gatech!uflorida!kluge!scs!mackey From: mackey@scs.fiu.edu Newsgroups: comp.lang.ada Subject: Re: A Modest Exercise in Ada Program Portability Summary: dining philosophers, Ada portability Message-ID: <1829@kluge.fiu.edu> Date: 27 Nov 90 23:11:36 GMT References: <2373@sparko.gwu.edu> Sender: news@kluge.fiu.edu Distribution: usa Organization: %BS-F-QXCD, Bullshit quota exceeded, core dumped. List-Id: 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. .