[ Table of Contents ] [ Prev ] [ Chapter Overview ] [ Glossary/Index ]
As usual, we begin with some self-test questions. (Answers are listed below in
Click Q#-# to see Answer
||Can a task be a library unit?
||What is the rendezvous mechanism used for?
||How many branches can a select statement have a) when it
appears in a calling task, and b) when it appears in a called task?
||Where can a terminate alternative appear?
||How many kinds of protected operations can appear in a
protected type or protected object declaration?
||What distinguishes a protected entry body from a
protected procedure body?
||What is the effect of a requeue statement?
Key points of this chapter
- Ada is unusual in that it has multi-tasking capabilities built into the language itself.
- Multi-tasking involves program units called task types, tasks, protected
types, and protected objects. These units are always nested in other units; they are never
- Tasks and protected objects are objects, and can be either statically declared or
- Task types and tasks export entries. For every entry declared in a task
declaration, there must be at least one accept statement in the task
- Entry call statements have the same form as procedure call statements. Task entries have
the following attributes: 'Count, 'Callable, and 'Terminated. (Count is the number of
calling tasks on an entry queue.)
- The select statement is a compound statement used to provide for the
selection of alternative choices involving a rendezvous between two tasks.
- A task can be terminated using a terminate alternative (in a select
statement) or an abort statement.
- A protected object provides coordinated access to shared data through calls on its
visible protected operations. There are three kinds of protected operations: procedures,
functions, and entries. Every protected entry body has a barrier condition.
- The effect of a requeue statement is to place the calling task at the
end of a different entry queue.
- Partitions, as defined in Annex E, can be used to build single Ada programs that run on
multiple, distributed processors.
||A requeue statement places the calling
task on a different entry queue.
||Every protected entry body has a
barrier condition. A procedure body never has a barrier condition.
||There are three kinds of protected
operations: procedures, functions and entries.
||A terminate alternative can appear only as the
last alternative of a selective accept statement.
||A select statement in a calling task can
have only two branches. In a called task a select statement can have any number of
||Rendezvous is used to synchronize the actions of
two tasks, and may also be used to transfer data between them.
||No, task units (and protected units) must
always be nested in other units.
[ Click here to return
to questions ]
This chapter has provided an introductory discussion of concurrency and
synchronization, Ada style, along with example programs illustrating relevant language
features and techniques. Key terms included in the Glossary/Index are:
This concludes the final chapter. The appendices contain reference material, mostly
adapted from [ARM95].
[ Back to top of page
] [ Prev ] [ To Appendix A ]