comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.EDU.AU>
Subject: Re: Ada Tasks and Keyboard I/O
Date: 1997/06/14
Date: 1997-06-14T00:00:00+00:00	[thread overview]
Message-ID: <5nu0ma$lnb$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 33A12825.1C80@onlink.net


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 <grr>.
 
 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




  parent reply	other threads:[~1997-06-14  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 Ada Tasks and Keyboard I/O David H. Haley
1997-06-14  0:00 ` Larry Kilgallen
1997-06-14  0:00   ` Robert Dewar
1997-06-14  0:00 ` John Herro
1997-06-14  0:00 ` Dale Stanbrough [this message]
1997-06-14  0:00 ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox