comp.lang.ada
 help / color / mirror / Atom feed
From: harold@harvax.UUCP (Harold Rabbie)
Subject: Interactive I/O in Ada
Date: 23 Jan 90 21:25:30 GMT	[thread overview]
Message-ID: <9001232125.AA09245@monolith.> (raw)


Bill Wolfe writes:

>> In the current issue of ACM SIGAda Ada Letters, Doug Bryan provides
>> a simple answer to a commonly asked question: How does one do keyboard
>> input in Ada while having other tasks do some work in the background
>> in between keystrokes?  Since Text_IO generally is 
>> not implemented so as to permit this to be done trivially
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   
My question is:  WHY NOT?  The reason TEXT_IO isn't pre-emptible on
most systems is that the scheduler in the underlying OS isn't aware of the
Ada tasking scheduler.  It blocks on the call to read() or whatever, never
allowing the Ada scheduler to regain control.  This is just a BAD 
IMPLEMENTATION.  There's no reason why TEXT_IO shouldn't check before
issuing a potentially blocking system call, and then use an asynchronous
type of request.

Better yet, on embedded systems, you can use an operating system that only
has a single level of scheduling.  If an Ada task makes a blocking call, like
TEXT_IO, then the scheduler can find another Ada task to run.  Moral of the
story: if real-time I/O is important to you, then use a real-time Ada OS.
Accept no substitute.

--------------------------+--------------------------------------------
Harold Rabbie, Ready Systems   "when REAL_TIME => accept READY_SYSTEMS;"
UUNET: {sun!pyramid,hplabs}!harvax!harold ARPA: rabbieh@ajpo.sei.cmu.edu
--------------------------+--------------------------------------------

             reply	other threads:[~1990-01-23 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-01-23 21:25 Harold Rabbie [this message]
1990-01-24 18:12 ` Interactive I/O in Ada Edward Falis
  -- strict thread matches above, loose matches on Subject: below --
1990-01-19  4:01 Bill Wolfe
replies disabled

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