Book contents
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 The nature and uses of concurrent programming
- 3 Inter-process communication
- 4 Task types and objects
- 5 The rendezvous
- 6 The select statement and the rendezvous
- 7 Protected objects and data-oriented communication
- 8 Avoidance synchronisation and the requeue facility
- 9 Exceptions, abort and asynchronous transfer of control
- 10 Object-oriented programming and tasking
- 11 Concurrency utilities
- 12 Tasking and systems programming
- 13 Scheduling real-time systems – fixed priority dispatching
- 14 Scheduling real-time systems – other dispatching facilities
- 15 Timing events and execution-time control
- 16 Real-time utilities
- 17 Restrictions, metrics and the Ravenscar profile
- 18 Conclusion
- References
- Index
15 - Timing events and execution-time control
Published online by Cambridge University Press: 10 December 2009
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 The nature and uses of concurrent programming
- 3 Inter-process communication
- 4 Task types and objects
- 5 The rendezvous
- 6 The select statement and the rendezvous
- 7 Protected objects and data-oriented communication
- 8 Avoidance synchronisation and the requeue facility
- 9 Exceptions, abort and asynchronous transfer of control
- 10 Object-oriented programming and tasking
- 11 Concurrency utilities
- 12 Tasking and systems programming
- 13 Scheduling real-time systems – fixed priority dispatching
- 14 Scheduling real-time systems – other dispatching facilities
- 15 Timing events and execution-time control
- 16 Real-time utilities
- 17 Restrictions, metrics and the Ravenscar profile
- 18 Conclusion
- References
- Index
Summary
This chapter introduces a number of language features that are new in Ada 2005. The main focus is on execution time and how tasks can monitor and control the amount of processor time they are using. For real-time systems this is of crucial importance as the processor is usually the resource in least supply. It needs to be
used in a manner that is sympathetic to the scheduling policy of the system,
not over-used by failing components (tasks), but
fairly reallocated dynamically if spare capacity becomes available.
However before considering these topics, a more general view of Ada's model of event handling is warranted. The facilities for execution-time control all make use of events and event handling, and hence this chapter will start by examining events and a particular kind of event termed a timing event.
Events and event handling
It is useful in concurrent systems to distinguish between two forms of computation that occur at run-time: tasks and events. A task (or process or thread) is a long-lived entity with state and periods of activity and inactivity. While active, it competes with other tasks for the available resources – the rules of this competition are captured in a scheduling or dispatching policy (for example, fixed priority or EDF). By comparison, an event is a short-lived, stateless, one-shot computation. Its handler's execution is, at least conceptually, immediate; and having completed it has no lasting direct effect other than by means of changes it has made to the permanent state of the system. When an event occurs we say it is triggered; other terms used are fired, invoked and delivered.
- Type
- Chapter
- Information
- Concurrent and Real-Time Programming in Ada , pp. 361 - 390Publisher: Cambridge University PressPrint publication year: 2007