comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Interrupt "Get"
Date: 1998/05/21
Date: 1998-05-21T00:00:00+00:00	[thread overview]
Message-ID: <dewar.895755957@merv> (raw)
In-Reply-To: %1N81.460$ja.2197141@newsread.com


<<Sorry John -- as you have stated the problem the answer is no. If there are
only
two tasks then the critical region of task_1 (the part following the "do"
and down to
the end of the rendezvous) will execute at the same priority as the
"calling" task. As
a result the CPU will not be available to task_2 (the "calling" task). Of
course there
are always some possibilities. The simplest is to remove the "do",  and then
if
your ada compiler supports time slicing both tasks can continue to execute.
>>


This is misleading. In any implementation of Ada where tasks map to
operating systems threads, and any reasonable operating system, the
I/O call will block the task that executes it, but not other tasks.
This answer is written from the narrow perspective of an Ada
implkementation in which operating systems threads are not used,
but these days, use of operating systems threads is the normal case,
or at least is an option (e.g. in GNAT, we provide both OS threads,
and user level threads, because both are useful in some contexts).

Note that relying on time slicing is not appropriate. Indeed the only
defined dispatching protocol in Ada 95 absolutely *forbids* time
slicing on a single processor.

Once again, if you are using an obsolete operating system like DOS that
does not provide any kind of operating system threads support, yes, indeed
I/O (and anything else) will block all tasks and there is no easy way around
this problem, although it is easy enough to special case keyboard I/O (the
Alsys compilers for DOS did this, I wrote the code that was needed :-)
However, this was not done in the old ACT version of DOS, which is no longer
supported. It is possible that the volunteer version of DOS that someone or
other is working on may have had this feature added.





  parent reply	other threads:[~1998-05-21  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-20  0:00 Interrupt "Get" John Slavich
     [not found] ` <%1N81.460$ja.2197141@newsread.com>
1998-05-21  0:00   ` Robert Dewar [this message]
1998-05-22  0:00     ` Michael F Brenner
1998-05-21  0:00 ` Robert Dewar
1998-05-21  0:00   ` John Slavich
1998-05-21  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1998-05-28  0:00 Joseph Altea
replies disabled

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