Section 13.1 - Tasking Basics

The Ada language includes built-in support for concurrent (parallel) processing with Ada tasks. Ada tasks run concurrently and can interact with each other using a few different mechanisms. In essence, each Ada task works as though it were running on a separate computer. Tasks are called by some people ``threads'' or ``light-weight processes''. More general terms for task-like behavior include ``process'', ``agent'', and ``active object''.

Why would you want to use tasks? Well, here's one example - let's imagine you're developing a World Wide Web browser. Such a browser must download information through some (slow) communication device and then display the information. Now, you could wait until all the information was available and then display it, but that would make the user wait for a possibly long time. A better solution would be to have two tasks - one that downloads the information, and another that displays the information. As the first task gathers more information, it could pass portions of what it's downloaded along to the second task. The second task could work to display information to the user, even if the first task hasn't finished gathering its data yet. Both tasks could then work ``simultaneously''.

Tasks can be started up (activated) and stopped (terminated). There are a variety of ways tasks can communicate with each other once they are activated; the main ways are:

We'll discuss these different communication methods in the next few sections.

Some computing systems actually have several computers built into them. If the Ada compiler and/or operating system can do so, different tasks may be run on different machines, which may significantly speed up execution of a program.

There are some important caveats about tasks:

Technically speaking, an Ada program always includes at least one task, called the environment task; the main (starting) subprogram runs in this environment task.


Software XYZ is running on a single processor and has 10,000 tasks. There's a task for every switch on an input panel and a task for every light on a display panel. Does this sound like a good design?

  1. This is probably a good design.
  2. This is probably not a good design.

You may also:

PREVIOUS Go back to the previous section

NEXT     Skip to the next section

OUTLINE  Go up to lesson 13 outline

David A. Wheeler (

The master copy of this file is at "".