100% found this document useful (2 votes)
4K views

Alan Burns, Andy Wellings - Real-Time Systems and Programming Languages - Ada, Real-Time Java and C - Rea

Programación en Sistemas de Tiempo Real.

Uploaded by

jcvg3110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
100% found this document useful (2 votes)
4K views

Alan Burns, Andy Wellings - Real-Time Systems and Programming Languages - Ada, Real-Time Java and C - Rea

Programación en Sistemas de Tiempo Real.

Uploaded by

jcvg3110
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 621
WatiD eT) a tele biter a ee and Programming . Languages’ “Ada, Real-Time eve and C/Real- Time Boh — ~ Alan Burns Andy Wellings Real-Time Systems and Programming Languages INTERNATIONAL COMPUTER SCIENCE SERIES Consulting Editor A D McGettrick University of Strathclyde SELECTED TITLES IN THE SERIES Concurrent Systems: An Integrated Approach to Operating Systems, Database, and Distributed Sys Programming Language Essentials H E Bal and D Grune Programming in Ada 95 (2nd edn) J G P Barnes Java Gently (3rd edn) J Bishop Software Design D Budgen Concurrent Programming A Burns and G Davies Real-Time Systems and Programming Languages: Ada 95, Real-Time Java and Real-Time POSIX (3rd edn) A Burns and A J Wellings Comparative Programming Languages, (3rd edn) Wilson and Clark, updated by Clark Distributed Systems: Concepts and Design (3rd edn) G Coulouris, J Dollimore and T Kindberg Principles of Object-Oriented Software Development (2nd edn) A Eliéns Fortran 90 Programming TM R Ellis, RR Philips and T M Lahey Program Verification N Francez Introduction to Programming using SML M Hansen and H Rischel Functional C P Hartel and H Muller Ada 95 for C and C++ Programmers S Johnston Algorithms and Data Structures: Design, Correctness, Analysis (2nd edn) J Kingston Introductory Logic and Sets for Computer Scientists N Nissanke Human-Computer Interaction J Preece et al. Algorithms: a Functional Programming Approach F Rabhi and G Lapalme Ada 95 From the Beginning (3rd edn) J Skansholm C++ From the Beginning J Skansholm Java From the Beginning J Skanshol Software Engineering (6th edn) J Sommerville Object-Oriented Programming in Eiffel (2nd edn) P Thomas and R Weedon Miranda: The Craft of Functional Programming S$ Thompson Haskell: The Craft of Functional Programming (2nd edn) S Thompson Discrete Mathematics for Computer Scientists (2nd edn) J K Truss Compiler Design R Wilhelm and D Maurer Discover Delphi: Programming Principles Explained § Williams and S Walmsley Software Engineering with B J B Wordsworth Real-Time Systems and Programming Languages Ada, Real-Time Java and C/Real-Time POSIX Fourth Edition Alan Burns and Andy Wellings University of York vw ADDISON-WESLEY ‘An ingrint of Pearson Education Harlow, England « London + New York + Boston « San Francisco « Toronto « Sydney « Singapore « Hong Kong Tokyo + Seoul + Taipei + New Delhi + Cape Town + Mack» Mexico City « Amsterdam + Munich » Paris « Milan Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2UE England ‘and Associated Companies throughout the world Visit us on the World Wide Web at: www.pearsoned.co.uk First published 1989 Second edition 1997 ‘Third edition 2001 Fourth edition published 2009 © Pearson Education Limited 1989, 2009 “The rights of Alan Burns and Andy Wellings to be identified as authors of this work have been asserted by them in accordance with the Copyright, Designs and Patents Act 1988, All rights reserved. No part ofthis publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or ‘otherwise, without either the prior written permission of the publisher or a licence permitting restricted copying in the United Kingdom issued by the Copyright Licensing Agency Ltd, Saffron House, 6-10 Kirby Street, London ECIN 81S. All trademarks used herein are the property of their respective owners. The use of any trademark in this text does not vest in the author or publisher any trademark ownership rights in such trademarks, nor does the use of such trademarks imply any affiliation with or endorsement of this book by such ‘owners. ISBN: 978-0-321-41745.9 British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library Library of Congress Cataloging-in-Publication Data A catalogue record for this book can be obtained from the Library of Congress 10987654321 13.1211 1009 ‘Typeset in Times Roman 10/12 by 73 Printed in Great Britain by Henry Ling Ltd. at the Dorset Press, Dorchester, Dorset The publisher's policy is to use paper manufactured from sustainable forests. Contents Preface 1 Introduction to real-time systems Ll 1.2 Examples of real-time systems .. 1.3. Characteristics of real-time systems 14 — Development cycle for real-time systems... 1.5 Languages for programming real-time systems Summary : Further reading. Exercises Definition of a real-time system .... Reliability and fault tolerance 2.1 Reliability, failure and faults 2.2 Failure modes ........... 2.3. Fault prevention and fault tolerance 24 — N-version programming 2.5 Software dynamic redundancy . 2.6 The recovery block approach to software fault tolerance 2.7 A comparison between N-version programming and recovery blocks .. 2.8 Dynamic redundancy and exceptions. 2.9 Measuring and predicting the reliability of software 2.10 Safety, reliability and dependability Summary Further reading Exercises 1.2... Exceptions and exception handling 3.1 3,2 33 34 Exception handling in older real-time languages : Modern exception handling : Exception handling in Ada, Java and C Recovery blocks and exceptions vi CONTENTS Summary oo. cceeeeeeeeeeeeeees be eetteereetteteseeeeeetesreeeeeee B8 Further reading. . 89 Exercises ..... . 89 Concurrent programming 95 4.1 Processes and tasks/threads 96 4.2 Concurrent execution 99 4.3. Task representation. 103 44 Concurrent execution in ‘Ada 105 4.5 Concurrent execution in Java 1 4.6 Concurrent execution in C/Real-Time POSIX... 16 4.7 Multiprocessor and distributed systems ....... 121 4.8 A simple embedded system 125 4.9 Language-supported versus operating-system-supported concurrency 131 Summary 132 Further reading. 133 Exercises 133 Shared variable-based synchronization and communication 137 5.1 Mutual exclusion and condition synchronization. 138 5.2 Busy waiting 139 5.3 Suspend and resume 142 5.4 Semaphores . w 145 5.5 Conditional critical regions . 156 5.6 Monitors 157 5.7 Mutexes and condition variables in C/Real-Time POSIX 160 5.8 Protected objects in Ada 5.9 Synchronized methods in Java 5.10 Shared memory multiprocessors. . 5.11 Simple embedded system revisited. 163 171 179 Summary Further reading Exercises 187 Message-based synchronization and communication 193 6.1 Process synchronization 193 195, 196 201 202 205, 206 210 219 220 . 221 222 6.2 Task naming and message structure 6.3 Message passing in Ada 6.4 — Selective waiting . 6.5 The Ada select statement 6.6 Non-determinism, selective waiting and synchroni: 6.7 C/Real-Time POSIX message queues 6.8 Distributed systems : 6.9 Simple embedded s: Summary . Further reading Exercises tion primitives 7 10 CONTENTS: Atomic actions, concurrent tasks and reliability TA Atomic actions . 7.2. Atomic actions in C 7.3. Recoverable atomic actions 7.4 — Asynchronous notification 75 Asynchronous notification in C/Real’ 7.6 Asynchronous notification in Ada... 7.7 Asynchronous notification in Real-Time Java Summary Further reading. Exercises Resource control 8.1 Resource control and atomic actions 8.2 Resource management 8.3. Expressive power and ease of use. 84 The requeue facility ........ 8.5 Asymmetric naming and security 8.6 Resource usage 8.7 Deadlock Summary Further reading. Exercises Real-time facilities 9.1 The notion of time 9.2 Access to a clock 9.3 Delaying a task 9.4 Programming timeouts 9.5 Specifying timing requirements 9.6 ‘Temporal scopes ... Summary : Further reading. Exercises Programming real-time abstractions 10.1 Real-time tasks 10.2 Programming periodic activities. 10.3 Programming aperiodic and sporadic activities 10.4 The role of real-time events and their handlers 10.5 Controlling input and output jitter. 10.6 Other approaches for supporting temporal scopes Summary Further reading Exercises eal-Time POSIX, ‘ada and Real: ‘Time. Java. vii 227 228 232 240 245, 247 255 266 278 280 280 285 286 286 287 296 302 303 304 304 305 305 307 307 309 317 320 326 +» 328 . 332 333 333 335 336 338 349 356, 363 364 364

You might also like