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, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!mcnc!rti!jb From: jb@rti.UUCP (Jeff Bartlett) Newsgroups: comp.lang.ada Subject: Re: Help me to solve this problem! Message-ID: <1680@rti.UUCP> Date: Thu, 27-Aug-87 14:39:46 EDT Article-I.D.: rti.1680 Posted: Thu Aug 27 14:39:46 1987 Date-Received: Sat, 29-Aug-87 10:06:31 EDT References: <8708241839.AA01159@ucbvax.Berkeley.EDU> Organization: Research Triangle Institute, RTP, NC Summary: Async terminal IO in VAX Ada List-Id: In article <8708241839.AA01159@ucbvax.Berkeley.EDU>, ie53@NTSUVAX.BITNET (HAERIM LEE) writes: > procedure imore is -- Intelligent 'more' > > This program is similar to 'more' on Unix except its more > clever default behavior; that is, it keeps printing each ..... > "next screen" is printed, and it was sitting idle until I hit > the . I noticed that this is because the 'get' > statement in the main body does not return its control to > the task 'mon_user' when it is suspended (Is it?) by this input > operation, while the task 'mon_user' was already in a suspended > state and possibly in a ready state if the specified delay time > had passed. In this case, the control should be given 'mon_user' > so that the procedure call 'print_next' after the delay state- > ment can be executed. Actually, I found that the task 'mon_user' > did NOT become suspended when the 'get' was invoked, but remained > as a 'running' state. This can be shown using the VAX/VMS Symbolic > Debugger. > Shouldn't the state of the task 'mon_user' become > 'suspended' when the 'get' is called, if there are any 'ready' > tasks? If not, how do we easily implement such time-bombs for > input operations? What is the relationship between task states > and i/o operations? In Ada, are i/o operations done synchronously > or asynchronously? Seems to be 'synchronous' in the Vax Ada V1.3. > > -- Haerim Lee (IE53@NTSUVAX) See section 2.7 "Input-Output and Tasking" in "VAX Ada Programmer's Run-Time Reference Manual", p 2-73. I/O on SYS$INPUT, SYS$OUTPUT, SYS$COMMAND, and SYS$ERROR are 'synchronous'. TEXT_IO used ADA$INPUT and ADA$OUTPUT which is normally assigned to SYS$INPUT and SYS$OUTPUT. To get 'async' i/o, assign ADA$INPUT and ADA$OUTPUT to TT: in DCL. Jeff Bartlett Center for Digital Systems Research Research Triangle Institute jb@rti.rti.org