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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!mnetor!uunet!husc6!cca!mirror!ishmael!ada-uts!stt From: stt@ada-uts Newsgroups: comp.lang.ada Subject: Re: Question on Tasking and Text_IO Message-ID: <57900059@ada-uts> Date: 8 Jan 88 15:31:00 GMT References: <18242@grebyn.com> Nf-ID: #R:grebyn.com:-1824200:ada-uts:57900059:000:1616 Nf-From: ada-uts!stt Jan 8 10:31:00 1988 List-Id: The LRM does not state whether during I/O other tasks may/must proceed. If you consider I/O operations as simply very slow machine instructions, then it is "reasonable" that no other task proceeds during I/O. On the other hand, if you consider I/O a communication with some independent processor running in parallel with the CPU (e.g. the human at the keyboard, or a disk drive), then it would seem "reasonable" that the CPU would be available for running other tasks while the I/O operation is waiting for a response from the "other" processor. Obviously, most users would prefer the "communication with independent processor" model over the "very slow machine instruction" model, but alas, the LRM doesn't specify which is required. There are some folks who feel that on philosophical grounds the "very slow machine instruction" model is actually more logical, but they of course would never want to use it to try to build a highly interactive application. In any case, one way to protect yourself is to have an input task which checks for the presence of input before reading it (this is possible in some O/Ss). If no input is present, it does an Ada DELAY and checks again. Once input is present, it reads it, causing minimal interruption to other tasks. Another alternative available on Unix(R) systems (presuming you drop into C), is to set an alarm and then read input. When the alarm expires, the "read" will return with an error, the task may then do an Ada delay (to allow other tasks to proceed for awhile) before retrying the alarmed read. S. Tucker Taft c/o Intermetrics, Inc. Cambridge, MA 02138