Ada as a real time language

10 views
Skip to first unread message

Marcus Hedlund

unread,
Aug 28, 2002, 7:42:20 AM8/28/02
to
Hi!

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

//M.Hedlund


David Brown

unread,
Aug 28, 2002, 8:13:54 AM8/28/02
to

"Marcus Hedlund" <marcus....@avionics.saab.se> wrote in message
news:akicju$k3p$1...@newstoo.ericsson.se...

> Hi!
>
> 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?
>

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.

Pat Rogers

unread,
Aug 28, 2002, 9:03:56 AM8/28/02
to
"Marcus Hedlund" <marcus....@avionics.saab.se> wrote in message
news:akicju$k3p$1...@newstoo.ericsson.se...
> 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?

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

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:

http://www.adaic.org/standards/95rat/RAThtml/rat95-p3-d.html

Hope that helps,


--
Patrick Rogers Consulting and Training in:
http://www.classwide.com Real-Time/OO Languages
pro...@classwide.com Hard Deadline Schedulability Analysis
(281)648-3165 Software Fault Tolerance


Mikael Lundqvist

unread,
Aug 28, 2002, 11:25:50 AM8/28/02
to
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?

Regards,
Mikael

Marcus Hedlund wrote:

> Hi!


>
> 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?
>

Thierry Lelegard

unread,
Aug 28, 2002, 11:44:26 AM8/28/02
to
> 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?

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.

-Thierry Lelegard

Pat Rogers

unread,
Aug 28, 2002, 11:44:53 AM8/28/02
to
"Mikael Lundqvist" <mikael.l...@avionics.saab.se> wrote in
message news:3D6CEB7E...@avionics.saab.se...

> 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?

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.


Steve O'Neill

unread,
Aug 28, 2002, 11:49:16 AM8/28/02
to
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.

Well, I certainly can't speak for all implementations but I would
consider this to be
1) a sweeping generalization
2) hearsay
3) urban legend

In any case I'd prefer that you not repeat this kind of potential
mis-information.
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.

Steve O'Neill

Larry Kilgallen

unread,
Aug 28, 2002, 1:01:44 PM8/28/02
to
In article <3D6CEB7E...@avionics.saab.se>, Mikael Lundqvist <mikael.l...@avionics.saab.se> writes:
> 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?

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.

Jerry Petrey

unread,
Aug 28, 2002, 8:47:58 PM8/28/02
to

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
without
any problems.

Jerry
--
---------------------------------------------------------------------------------

-- Jerry Petrey
-- Senior Principal Systems Engineer - Navigation (GPS/INS), Guidance, &
Control
-- Raytheon Missile Systems - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply
---------------------------------------------------------------------------------

salim...@gmail.com

unread,
Oct 30, 2014, 11:14:13 AM10/30/14
to
There no place to download sample codes for ada . I was searching for a small interrupt Handling code for a PIT. I couldn't find any

Salim
Reply all
Reply to author
Forward
0 new messages