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.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c9138bc72eca8fee X-Google-Attributes: gid103376,public From: Dale Stanbrough Subject: Re: Ada Tasks and Keyboard I/O Date: 1997/06/14 Message-ID: <5nu0ma$lnb$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 248332377 Distribution: world References: <33A12825.1C80@onlink.net> X-XXMessage-ID: Organization: Royal Melbourne Institute of Technology Newsgroups: comp.lang.ada Date: 1997-06-14T00:00:00+00:00 List-Id: David H. Haley writes: "I have developed a software package in Ada and thought it would be nice to have the time perodically updated on the screen while waiting for the user to input a value from the keyboard. This "sounds" easy enough to do using tasks; however, once the program reaches the Get(My_Number) statement all other tasks come to a grinding halt waiting for this keyboard I/O to occur . Any ideas how I can accomplish the requirement in para 1 ? I am using Meridian OpenAda Dos ver 4.1.4, an ADA 83 compiler." Link with bamp -I to provide task preemption, then as one of the first things your program does (perhaps even in a task elaboration section)... task_control.pre_emption_on; This will prevent iio.get from hogging all the limelight. Package task_control is described as (on p32 of the compiler's user guide)... package Task_Control is procedure Pre_Emption_On; procedure Pre_Emption_Off; procedure Set_Time_Slice (Quota : Duration); end Task_Control; I always did have quite a soft spot for the Meridian Ada compiler. It seemed to (almost) always do what was expected of it. Dale