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!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!ucbvax!grebyn.COM!karl From: karl@grebyn.COM (Karl A. Nyberg) Newsgroups: comp.lang.ada Subject: Question on Tasking and Text_IO Message-ID: <8801070327.AA18242@grebyn.com> Date: 7 Jan 88 03:27:07 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: [Ed. - this is being forwarded becuase the original sender is having difficulty with the ARPANET. p.s. to P. S. - let me know that you see this.] ------------------------------------------------------------------------ Help! I have been attempting to use Tasking in my work in real-time signal processing on VAX/VMS, ALSYS and Meridian Ada compilers. One task (the main program) is dedicated to handling user interaction, and other tasks run around doing the real-time stuff. I came across a problem on the Alsys system where once entry of a data field was started, the other tasks in the system freeze, and the PC seems to be totally dedicated to handling the user input. I tried this on the DEC VAX/VMS and Meridian compilers, and ended up with three different responses, one for each compiler. What gives? Am I missing something big, or does Ada not care whether a single task performing Text_IO calls can block the reset of a system? The code fragment which follows illustrates the three responses that were obtained (P.S. in the actual program I use a mailbox and not a shared variable!): The three classes of response were: DEC VAX/VMS: with $ DEFINE ADA$INPUT TT: the A_Task updates the shared variable at 10 Hz, as expected. ALSYS on SPERRY-IT Correct updating of the shared variable until the first character of the command is entered, then A_Task freezes. Time-slicing does not help. MERIDIAN on COMPAQ-386 The shared variable is never updated. Pragma Priority does not help. Does this also mean that I have to provide a machine-dependent mechanism for user interaction in the presence of tasking? I would appreciate any comments on this dilemma. P.S.Tuffs CS-NET: Tuffs@alcoa.com Mail: P.S.Tuffs Alcoa Technical Center, Alcoa Center Pa 15069. ------------------------------------------------------------------------------- -- An example of how the Text_IO.Get for enumerations can block a task with Text_Io; procedure Task_Blk is Shared_Variable: Integer := 0; task A_Task is entry Stop; end A_Task; type Commands is (Help, Stop); The_Command: Commands; package Command_Io is new Text_Io.Enumeration_IO(Commands); task body A_Task is begin loop select accept Stop; exit; or delay 0.1; Shared_Variable := Shared_Variable + 1; end select; end loop; end A_Task; begin loop Text_IO.Put("Enter the command: "); Command_IO.Get(The_Command); exit when The_Command = Stop; Text_Io.Put_Line("The variable is: " & Integer'Image(Shared_Variable)); end loop; A_Task.Stop; end Task_Blk; -------------------------------------------------------------------------------