|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 5120 (0x1400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Room, seg_058313
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
--::::::::::
--roomline.adb
--::::::::::
with Text_Io;
with Chop;
with Phil;
with Calendar;
pragma Elaborate (Phil);
package body Room is
-- A line-oriented version of the Room package, for line-oriented
-- terminals like IBM 3270's where the user cannot do ASCII screen control.
-- This is the only file in the dining philosophers system that needs
-- changing to use in a line-oriented environment.
-- Michael B. Feldman, The George Washington University, November 1990.
Phils : array (Table_Type) of Phil.Philosopher;
type Phil_Names is (Dijkstra, Texel, Booch, Ichbiah, Stroustrup);
task body Head_Waiter is
T : Integer;
Start_Time : Calendar.Time;
Phil_Names : constant array (1 .. 5) of String (1 .. 18) :=
("Eddy Dijkstra ", "Putnam Texel ", "Grady Booch ",
"Jean Ichbiah ", "Bjarne Stroustrup ");
Blanks : constant String := " ";
begin
accept Open_The_Room;
Start_Time := Calendar.Clock;
Phils (1).Come_To_Life (1, 1, 2);
Phils (3).Come_To_Life (3, 3, 4);
Phils (2).Come_To_Life (2, 2, 3);
Phils (5).Come_To_Life (5, 1, 5);
Phils (4).Come_To_Life (4, 4, 5);
loop
select
accept Report_State (Which_Phil : Table_Type;
State : Phil.States;
How_Long : Natural := 0) do
T := Integer (Calendar."-" (Calendar.Clock, Start_Time));
Text_Io.Put ("T=" & Integer'Image (T) & " " &
Blanks (1 .. Which_Phil) &
Phil_Names (Which_Phil));
case State is
when Phil.Breathing =>
Text_Io.Put ("Breathing");
when Phil.Thinking =>
Text_Io.Put ("Thinking" & Integer'Image (How_Long) &
" seconds.");
when Phil.Eating =>
Text_Io.Put ("Eating" & Integer'Image (How_Long) &
" seconds.");
when Phil.Done_Eating =>
Text_Io.Put ("Yum-yum (burp)");
when Phil.Got_One_Stick =>
Text_Io.Put ("First chopstick" &
Integer'Image (How_Long));
when Phil.Got_Other_Stick =>
Text_Io.Put ("Second chopstick" &
Integer'Image (How_Long));
end case;
Text_Io.New_Line;
end Report_State;
or
terminate;
end select;
end loop;
end Head_Waiter;
end Room;
nblk1=4
nid=0
hdr6=8
[0x00] rec0=21 rec1=00 rec2=01 rec3=00c
[0x01] rec0=16 rec1=00 rec2=03 rec3=068
[0x02] rec0=15 rec1=00 rec2=02 rec3=02a
[0x03] rec0=09 rec1=00 rec2=04 rec3=000
tail 0x2176590b687e288fbf2bf 0x42a00088462060003