I was just wondering about the real-time quality in the Ada language.
Is it possible to write a good hard real-time system without a RTOS, or
is it necesary to use a RTOS to achieve good real-time proporties?
Any help will be greatly appreciated
Don't know about Ada in practice (though it has a good reputation for use in
RT systems). In general, there is absolutely no need to use an RTOS to get
real-time response from a system - what you should not do is rely on a
non-real-time OS for real-time response. But for a great many systems,
there is no requirement for an OS at all.
For example, suppose you have a system that requires fast response to an
interrupt from a peripheral. With a real-time OS, you would make the driver
function for the interrupt a high priority task, and you might get a
guarenteed reaction time of within 10us. With a non-real-time OS, you might
normally get a reaction time of within 10us, but perhaps it will sometimes
take 500us if the system happens to be flushing data to flash just at that
time. But if you have a system without an OS, and make the interrupt a
high-priority interrupt, then you might be able to guarentee a response of
0.1us. It all depends on what sort of system you want to build, and what
sort of services (software and hardware) you want to support.
No, you don't need an RTOS to write real-time systems with Ada. The
language itself has all the necessary functionality that an RTOS would
provide strictly for that purpose: predictable scheduling with direct
support for schedulability analysis, low-level bit-twiddling,
predictable memory management, etc. It does not have all the
functionality of an RTOS built into it, such as a file system,
partitions a la ARINC 653, TCP/IP, and so forth, but those are
"extras" that may or may not be required for your application. If you
do need them, though, an RTOS is definitely the way to go -- it
certainly beats writing a TCP/IP interface yourself! Ada is
extensively supported on VxWorks, for example, to the same degree as
In fact the features you might think of as being for "real-time" are,
in Ada, designed for execution on bare machines. For example, the
mutual exclusion & condition synchronization mechanisms can have
better performance than one would find on an RTOS using semaphores and
the like and they are certainly more expressive too.
If you want to learn about the real-time features of the language,
have a look at Annex D of the official Rationale:
Hope that helps,
Marcus Hedlund wrote:
> I was just wondering about the real-time quality in the Ada language.
> Is it possible to write a good hard real-time system without a RTOS, or
> is it necesary to use a RTOS to achieve good real-time proporties?
There is no such thing as "THE" Ada Run Time. There are as many
implementations of an Ada Run Time as compiler/platform combinations.
Using DEC Ada (Ada83) on OpenVMS systems, we had applications
using up to 6000 tasks in one single process, with a high I/O
rate, which run quite smoothly. You can acheive this with a
robust and versatile O/S and a perfect integration of the Ada
Run Time with the underlying O/S.
To be precise, there is no such thing as *The* Ada Run-Time; perhaps
you heard about some vendor's buggy *implementation*? There is no
reason to expect an implementation to fail (is that what you mean by
"give in"?) because there are many tasks or a lot of I/O. Failure in
such a case would be a bug.
Certainly the performance will vary with the load, just as it would
with an (RT)OS present. If the performance degrades more quickly than
necessary, that is either a poor implementation or one that is making
tradeoffs in other areas that are not appropriate for the specific
application. Who knows.
For that matter, when Ada is used with an RTOS it is reasonable (and
probably typical) to expect that an Ada task is mapped directly to an
RTOS thread -- on other words, an Ada task *is* an RTOS thread -- so
there would be no difference. That is the case with GNAT on VxWorks,
to cite one example vendor and RTOS.
We'd be better sticking to facts than what one has heard.
Well, I certainly can't speak for all implementations but I would
consider this to be
1) a sweeping generalization
3) urban legend
In any case I'd prefer that you not repeat this kind of potential
Unless, of course, you have specific knowledge where this is true.
> In that regard you should be better of with a RTOS.
Maybe, maybe not.
> I have not any experience myself with large Ada programs.
Then I have to wonder about the value of this information.
> Anybody out there who could comment?
Yes. I *do* have experience with numerous Ada programs both large and
small. Some of these used RTOS' while others did not. I can say that
neither the Ada language nor the Ada run-time have ever been an obstacle
to producing real-time systems. As others have said the primary reason
that we would use an RTOS was for the other services that they provide -
not for performance reasons.
This is not to say that you should blindly ignore potential performance
issues - you must keep these in mind as you design your system.
There is no such entity as "the Ada Run Time". There may be one
associated with particular Ada implementations, but performance
characteristics are associated with particular implementations
and not with the conceptual notion.
Mikael Lundqvist wrote:
> I have heard that the Ada Run Time doesn't handle load
> that well. If you have to many tasks or to much input/output
> the Runtime gives in so to speak. In that regard you should
> be better of with a RTOS. I have not any experience myself
> with large Ada programs. Anybody out there who could comment?
We use DDCI Ada with its runtime on a 72 Mhz 80486 in the missile I work on.
It has about 32 tasks and handles all our navigation, guidance and control
-- Jerry Petrey
-- Senior Principal Systems Engineer - Navigation (GPS/INS), Guidance, &
-- Raytheon Missile Systems - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply