|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T V
Length: 1526 (0x5f6)
Types: TextFile
Names: »V«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
--
-- Version: @(#)shared.ada 1.1 Date: 5/30/84
--
--
-- Author: Bryce Bardin
-- Ada Projects Section
-- Software Engineering Division
-- Ground Systems Group
-- Hughes Aircraft Company
-- Fullerton, CA
--
-- This program illustrates the use of tasking to provide shared access
-- to global variables. N.B.: The values it outputs may vary from run
-- to run depending on how tasking is implemented.
-- A "FIFO" solution to the READERS/WRITERS problem.
-- Authors: Gerald Fisher and Robert Dewar.
-- (Modified by Bryce Bardin to terminate gracefully.)
-- May be used to provide shared access to objects by an arbitrary number of
-- readers and writers which are serviced in order from a single queue.
-- Writers are given uninterrupted access for updates and readers are assured
-- that updates are indivisible and therefore complete when read access is
-- granted.
--
-- If C is a task object of type Control and O is an object which is to be
-- shared between readers and writers using C, then:
--
-- readers should do:
--
-- C.Start(Read);
-- <read all or part of O>
-- C.Stop;
--
-- and writers should do:
--
-- C.Start(Write);
-- <update all or part of O>
-- C.Stop;
package Readers_Writers is
type Service is (Read, Write);
task type Control is
entry Start (Mode : Service); -- start readers or writers
entry Stop; -- stop readers or writers
end Control;
end Readers_Writers;