Table Of ContentSIMPLIFIED
APPROACH
TO
REAL TIME SYSTEM
Yogyata Jain
SIMPLIFIED APPROACH
TO
REAL TIME SYSTEM
SIMPLIFIED APPROACH TO
REAL TIME SYSTEM
By
Yogyata Jain
Assistant Professor (CSE)
JET Bhaddal, Ropar
(Formerly in Chitkara University Punjab)
8 UNIVERSITY SCIENCE PRESS
(An Imprint of Laxmi Publications (P) Ltd.)
BANGALORE • CHENNAI • COCHJN • GUWAHATI • HYDERABAD
JALANDHAR • KOLKATA • LUCKNOW • MUMBAI • RANCHI • NEW DELHI
INDIA • USA • GHANA • KENYA
SIMPLIFIED APPROACH TO REAL TIME SYSTEM
Cop(cid:455)right © (cid:271)(cid:455) La(cid:454)(cid:373)i Pu(cid:271)li(cid:272)aio(cid:374)s (cid:894)P(cid:895) Ltd.
All rights reser(cid:448)ed i(cid:374)(cid:272)ludi(cid:374)g those of tra(cid:374)slaio(cid:374) i(cid:374)to other la(cid:374)guages. I(cid:374) a(cid:272)(cid:272)orda(cid:374)(cid:272)e (cid:449)ith the Cop(cid:455)right (cid:894)A(cid:373)e(cid:374)d(cid:373)e(cid:374)t(cid:895) A(cid:272)t, (cid:1006)(cid:1004)(cid:1005)(cid:1006),
(cid:374)o part of this pu(cid:271)li(cid:272)aio(cid:374) (cid:373)a(cid:455) (cid:271)e reprodu(cid:272)ed, stored i(cid:374) a retrie(cid:448)al s(cid:455)ste(cid:373), or tra(cid:374)s(cid:373)ited i(cid:374) a(cid:374)(cid:455) for(cid:373) or (cid:271)(cid:455) a(cid:374)(cid:455) (cid:373)ea(cid:374)s, ele(cid:272)tro(cid:374)i(cid:272),
(cid:373)e(cid:272)ha(cid:374)i(cid:272)al, photo(cid:272)op(cid:455)i(cid:374)g, re(cid:272)ordi(cid:374)g or other(cid:449)ise. A(cid:374)(cid:455) su(cid:272)h a(cid:272)t or s(cid:272)a(cid:374)(cid:374)i(cid:374)g, uploadi(cid:374)g, a(cid:374)d or ele(cid:272)tro(cid:374)i(cid:272) shari(cid:374)g of a(cid:374)(cid:455) part of this
(cid:271)ook (cid:449)ithout the per(cid:373)issio(cid:374) of the pu(cid:271)lisher (cid:272)o(cid:374)situtes u(cid:374)la(cid:449)ful pira(cid:272)(cid:455) a(cid:374)d thet of the (cid:272)op(cid:455)right holder’s i(cid:374)telle(cid:272)tual propert(cid:455).
If (cid:455)ou (cid:449)ould like to use (cid:373)aterial fro(cid:373) the (cid:271)ook (cid:894)other tha(cid:374) for re(cid:448)ie(cid:449) purposes(cid:895), prior (cid:449)rite(cid:374) per(cid:373)issio(cid:374) (cid:373)ust (cid:271)e o(cid:271)tai(cid:374)ed fro(cid:373)
the pu(cid:271)lishers.
Typeset at E(cid:454)(cid:272)elle(cid:374)t Graphi(cid:272)s
First Ediio(cid:374): (cid:1006)(cid:1004)(cid:1005)(cid:1009)
USA-(cid:1013)(cid:1011)(cid:1008)(cid:1004)-(cid:1005)(cid:1009)(cid:1004)-SIMP APP REAL TIME SYS-JAI
ISBN (cid:1013)(cid:1011)(cid:1012)-(cid:1013)(cid:1007)-(cid:1012)(cid:1007)(cid:1012)(cid:1006)(cid:1012)-(cid:1007)(cid:1010)-(cid:1008)
Limits of Liability/Disclaimer of Warranty: The pu(cid:271)lisher a(cid:374)d the author (cid:373)ake (cid:374)o represe(cid:374)taio(cid:374) or (cid:449)arra(cid:374)ies (cid:449)ith respe(cid:272)t to the
a(cid:272)(cid:272)ura(cid:272)(cid:455) or (cid:272)o(cid:373)plete(cid:374)ess of the (cid:272)o(cid:374)te(cid:374)ts of this (cid:449)ork a(cid:374)d spe(cid:272)ifi(cid:272)all(cid:455) dis(cid:272)lai(cid:373) all (cid:449)arra(cid:374)ies. The ad(cid:448)i(cid:272)e, strategies, a(cid:374)d a(cid:272)i(cid:448)iies
(cid:272)o(cid:374)tai(cid:374)ed herei(cid:374) (cid:373)a(cid:455) (cid:374)ot (cid:271)e suita(cid:271)le for e(cid:448)er(cid:455) situaio(cid:374). I(cid:374) perfor(cid:373)i(cid:374)g a(cid:272)i(cid:448)iies adult super(cid:448)isio(cid:374) (cid:373)ust (cid:271)e sought. Like(cid:449)ise,
(cid:272)o(cid:373)(cid:373)o(cid:374) se(cid:374)se a(cid:374)d (cid:272)are are esse(cid:374)ial to the (cid:272)o(cid:374)du(cid:272)t of a(cid:374)(cid:455) a(cid:374)d all a(cid:272)i(cid:448)iies, (cid:449)hether des(cid:272)ri(cid:271)ed i(cid:374) this (cid:271)ook or other(cid:449)ise. Neither
the pu(cid:271)lisher (cid:374)or the author shall (cid:271)e lia(cid:271)le or assu(cid:373)es a(cid:374)(cid:455) respo(cid:374)si(cid:271)ilit(cid:455) for a(cid:374)(cid:455) i(cid:374)juries or da(cid:373)ages arisi(cid:374)g herefro(cid:373). The fa(cid:272)t that
a(cid:374) orga(cid:374)izaio(cid:374) or We(cid:271)site if referred to i(cid:374) this (cid:449)ork as a (cid:272)itaio(cid:374) a(cid:374)d/or a pote(cid:374)ial sour(cid:272)e of further i(cid:374)for(cid:373)aio(cid:374) does (cid:374)ot (cid:373)ea(cid:374)
that the author or the pu(cid:271)lisher e(cid:374)dorses the i(cid:374)for(cid:373)aio(cid:374) the orga(cid:374)izaio(cid:374) or We(cid:271)site (cid:373)a(cid:455) pro(cid:448)ide or re(cid:272)o(cid:373)(cid:373)e(cid:374)daio(cid:374)s it (cid:373)a(cid:455)
(cid:373)ake. Further, readers (cid:373)ust (cid:271)e a(cid:449)are that the I(cid:374)ter(cid:374)et We(cid:271)sites listed i(cid:374) this (cid:449)ork (cid:373)a(cid:455) ha(cid:448)e (cid:272)ha(cid:374)ged or disappeared (cid:271)et(cid:449)ee(cid:374)
(cid:449)he(cid:374) this (cid:449)ork (cid:449)as (cid:449)rite(cid:374) a(cid:374)d (cid:449)he(cid:374) it is read.
All trade(cid:373)arks, logos or a(cid:374)(cid:455) other (cid:373)ark su(cid:272)h as Vi(cid:271)g(cid:455)or, USP, A(cid:373)a(cid:374)da, Golde(cid:374) Bells, Fire(cid:449)all Media, Mer(cid:272)ur(cid:455), Tri(cid:374)it(cid:455), La(cid:454)(cid:373)i
appeari(cid:374)g i(cid:374) this (cid:449)ork are trade(cid:373)arks a(cid:374)d i(cid:374)telle(cid:272)tual propert(cid:455) o(cid:449)(cid:374)ed (cid:271)(cid:455) or li(cid:272)e(cid:374)sed to La(cid:454)(cid:373)i Pu(cid:271)li(cid:272)aio(cid:374)s, its su(cid:271)sidiaries or
affiliates. Not(cid:449)ithsta(cid:374)di(cid:374)g this dis(cid:272)lai(cid:373)er, all other (cid:374)a(cid:373)es a(cid:374)d (cid:373)arks (cid:373)e(cid:374)io(cid:374)ed i(cid:374) this (cid:449)ork are the trade (cid:374)a(cid:373)es, trade(cid:373)arks or
ser(cid:448)i(cid:272)e (cid:373)arks of their respe(cid:272)i(cid:448)e o(cid:449)(cid:374)ers.
& Ba(cid:374)galore (cid:1004)(cid:1012)(cid:1004)-(cid:1006)(cid:1010) (cid:1011)(cid:1009) (cid:1010)(cid:1013) (cid:1007)(cid:1004)
& Che(cid:374)(cid:374)ai (cid:1004)(cid:1008)(cid:1008)-(cid:1006)(cid:1008) (cid:1007)(cid:1008) (cid:1008)(cid:1011) (cid:1006)(cid:1010), (cid:1006)(cid:1008) (cid:1007)(cid:1009) (cid:1013)(cid:1009) (cid:1004)(cid:1011)
& Co(cid:272)hi(cid:374) (cid:1004)(cid:1008)(cid:1012)(cid:1008)-(cid:1006)(cid:1007)(cid:1011) (cid:1011)(cid:1004) (cid:1004)(cid:1008), (cid:1008)(cid:1004)(cid:1009) (cid:1005)(cid:1007) (cid:1004)(cid:1007)
& Gu(cid:449)ahai (cid:1004)(cid:1007)(cid:1010)(cid:1005)-(cid:1006)(cid:1009)(cid:1008) (cid:1007)(cid:1010) (cid:1010)(cid:1013), (cid:1006)(cid:1009)(cid:1005) (cid:1007)(cid:1012) (cid:1012)(cid:1005)
es & H(cid:455)dera(cid:271)ad (cid:1004)(cid:1008)(cid:1004)-(cid:1006)(cid:1011) (cid:1009)(cid:1009) (cid:1009)(cid:1007) (cid:1012)(cid:1007), (cid:1006)(cid:1011) (cid:1009)(cid:1009) (cid:1009)(cid:1007) (cid:1013)(cid:1007)
h
nc & Jala(cid:374)dhar (cid:1004)(cid:1005)(cid:1012)(cid:1005)-(cid:1006)(cid:1006)(cid:1006) (cid:1005)(cid:1006) (cid:1011)(cid:1006)
Published in india by ra
B & Kolkata (cid:1004)(cid:1007)(cid:1007)-(cid:1006)(cid:1006) (cid:1006)(cid:1011) (cid:1008)(cid:1007) (cid:1012)(cid:1008)
UNIVERSITY SCIENCE PRESS & Lu(cid:272)k(cid:374)o(cid:449) (cid:1004)(cid:1009)(cid:1006)(cid:1006)-(cid:1006)(cid:1006)(cid:1004) (cid:1013)(cid:1013) (cid:1005)(cid:1010)
& Mu(cid:373)(cid:271)ai (cid:1004)(cid:1006)(cid:1006)-(cid:1006)(cid:1008) (cid:1013)(cid:1005) (cid:1009)(cid:1008) (cid:1005)(cid:1009), (cid:1006)(cid:1008) (cid:1013)(cid:1006) (cid:1011)(cid:1012) (cid:1010)(cid:1013)
(An Imprint of Laxmi Publications Pvt.Ltd.) & Ra(cid:374)(cid:272)hi (cid:1004)(cid:1010)(cid:1009)(cid:1005)-(cid:1006)(cid:1006)(cid:1004) (cid:1008)(cid:1008) (cid:1010)(cid:1008)
(cid:1005)(cid:1005)(cid:1007), GOLDEN HOUSE, DARYAGANJ,
NEW DELHI - (cid:1005)(cid:1005)(cid:1004)(cid:1004)(cid:1004)(cid:1006), INDIA
Telepho(cid:374)e : (cid:1013)(cid:1005)-(cid:1005)(cid:1005)-(cid:1008)(cid:1007)(cid:1009)(cid:1007) (cid:1006)(cid:1009)(cid:1004)(cid:1004), (cid:1008)(cid:1007)(cid:1009)(cid:1007) (cid:1006)(cid:1009)(cid:1004)(cid:1005)
Fa(cid:454) : (cid:1013)(cid:1005)-(cid:1005)(cid:1005)-(cid:1006)(cid:1007)(cid:1006)(cid:1009) (cid:1006)(cid:1009)(cid:1011)(cid:1006), (cid:1008)(cid:1007)(cid:1009)(cid:1007) (cid:1006)(cid:1009)(cid:1006)(cid:1012) C—
(cid:449)(cid:449)(cid:449).la(cid:454)(cid:373)ipu(cid:271)li(cid:272)aio(cid:374)s.(cid:272)o(cid:373) i(cid:374)fo@la(cid:454)(cid:373)ipu(cid:271)li(cid:272)aio(cid:374)s.(cid:272)o(cid:373)
For my Loving Son
HirdeyJain
&
Caring Husband
DeepakJain
Contents
Chapters Pages
1. Real Time System 1-14
1.1 Introduction 1
1.2 Architecture of Real Time System 2
1.3 Real Time System Tasks 2
1.4 Real Time Computing Issues 6
1.5 Real Time World 6
1.6 Real Time Operating System 8
1.7 Real Time System Components 9
1.8 Programming Styles 9
1.9 Communication Based Model 9
Summary 10
Exercises 10
Multiple Choice Questions 11
Questionnaires 12
2. Characterizing Real Time Systems 15-28
2.1 Real Time System Performance Measure 15
2.2 Properties of Performance Measure 16
2.3 Performability 18
2.4 Cost Functions and Hard Deadlines 22
Summary 25
Exercises 25
MulUple Choice Questions 27
Questionnaires 28
3. Task Assignment and Scheduling 29-59
3.1 Introduction 29
3.2 Scheduling Algorithms 34
3.3 Task Assignment 47
Summary 53
Exercises 54
Multiple Choice Questions 57
Questionnaires 58
4. Real Time Databases 60-78
4.1 Introduction 60
4.2 Scheduling of Real Time Database Transactions 64
4.3 Soft and Hard Transactions 64
4.4 Serializability 68
4.5 Main Memory Databases (MMDB) 69
4.6 Databases for Hard Real Time System 71
4.7 Thrashing Effect 73
Summary 74
Exercises 75
Multiple Choice Questions 76
Questionnaires 77
( vii)
(viii)
Chapters Pages
5. Real Time Communication 79-110
5.1 Introduction 79
5.2 Conventional Communication Vs. Real Time Communication 80
5.3 Communications Media 81
5.4 Types of Network 84
5.5 Architecture of Real Time Communication System 87
5.6 Token Based Protocol or Timed Token Protocol (TIP) 88
5.7 Deadline Based Protocols 91
5.8 Polled Bus Protocol 92
5.9 Contention Based Protocol 94
5.10 Stop and Go Multihop Protocol (SGMP) 98
5.11 Hierarchical Round Robin Protocol (HRR) 100
5.12 Virtual Time Carrier Sensed Multiple Access (VTCSMA) 102
5.13 Window Based Protocol 102
Summary 103
Exercises 104
Multiple Choice Questions 106
Questionnaires 107
6. Real Time Operating System 111-121
6.1 Introduction 111
6.2 RTOS Classification 112
6.3 Real Time OS Features 112
6.4 RTOS Architecture 113
6.5 Commercial Most Popular RTOS 118
6.6 RTOS Vs. General Operating System 118
Summary 119
Exercises 119
Multiple Choice Questions 120
Case Study 122-128
Bibliography 129
Abbreviations 130-133
Glossary of Terms 134-147
PTU Question Papers 148-160
Index 161-163
PREFACE
The book is in very simple language. I have tried to ensure that the book clear whole
concepts related to real time system. Book is according to PTU syllabus and I have specially
made it for PTU students. Daily life and practical examples used in book to clear the concepts
more clearly. To achieve this I have made six chapters of this book.
I felt a need to write a book on the subject that was simple and easy to understand. A
book can solve general facing problems and provide a comprehensive view of real time system.
This thought provided me to write a book on real time system.
Since this book provides comprehensive coverage of basic concepts of real time system
avoids complicated mathematical formula and makes minimal assumptions, it will benefit a
wide spectrum of audience. This includes students studying RTS for the fi.rst time or doing
research on RTS; engineers engaged in real time protocol design and marketing people. All
will find this book extremely readable and very informative.
Your comments are valuable to me. I will appreciate if you will notify me of any error or
admissions in the book. So, please send your comments and valuable suggestions for
improvement I will be glad to incorporate your comments for next edition of the book.
-Author
(ix)
ACKNOWLEDGEMENT
Writing and publishing of this book could not attain successfully without the support of
number of people associated with it and sincere efforts made by an author.
Firstly, I would like to thanks worthy chairperson Er. Kulwinder Gurcharan Singh,
Director General R. Jha and Associate Director J.S. Kanwar for their valuable direction.
I would also like to thanks Mrs. Jyoti Snehi Assistant Professor CSE Department in
Chitkara University Punjab for her valuable guidance.
I would also like to express my sincere gratitude to Dr. Sanjay Singla, HOD CSE
Department of lET Bhaddal, Ropar for inspiration and Mrs. Aarti Mahajan, CSE Department
Assistant Professor in lET Bhaddal for guiding me.
I would also deeply appreciate the assistance provided by my husband Deepak Jain, my
mother in law Rukmani Jain and father in law Arihant Jain for their invaluable help and
support for completion of this book.
-Author
( x)
OMSAINATH
(xi)