290 likes | 411 Views
System and Realtime Programming (G53SRP). Chris Greenhalgh School of Computer Science. Aim:. To look at the issues of programming relevant to real-time, concurrent and embedded systems where timeliness, reliability, concurrency and hardware interfacing are required.
E N D
System and Realtime Programming (G53SRP) Chris Greenhalgh School of Computer Science
Aim: • To look at the issues of programming relevant to real-time, concurrent and embedded systems • where timeliness, reliability, concurrency and hardware interfacing are required. • with particular emphasis on Java, including the Real-time Specification for Java
Pre- and co-requisites • Introduction to programming (G51PRG) • Moderate imperative programming competence, including methods & classes, to be applied in Java for examples, exercises and examination • Concepts of concurrency (G52CON) • Relevant material on Java threads and synchronization reviewed in the first few lectures.
Format • The teaching and assessment of this module comprises: • ~ 20 full-class lectures. • 1 RTSJ coursework and report (25%). • 1 written examination: 2 hours, unseen, 75%. • Plus (of course) you review the material, look at past papers, revise…
Support • Talk to or emailing the convener, Chris Greenhalgh: • in his office, room B2(CS building, 1stfloor, access over walkway from centre block, not through MRL!). • by email, cmg@cs.nott.ac.uk (repeatedly) • see also http://www.cs.nott.ac.uk/~cmg/
Resources • 2 lectures per week – • All lectures are compulsory. • Any cancellations will be announced in lectures and on the web page • notes available on-line as the course progresses. • a WWW page giving information about the course, exercises, assessment, special arrangements, etc (see CS Module Table):http://www.cs.nott.ac.uk/~cmg/G53SRP/
Textbooks • The course text-book, “Real-Time Programming in Java”, Andy Wellings, Wiley, 2004 ISBN 0-470-84437-X • The old course text-book, "Real-time systems and their programming languages", Alan Burns and Andy Wellings, Addison-Wesley, 2001 (third edition). • Second edition OK for non-RTJava-specific stuff.
Textbooks (ii) • See Library reading list for G53SRP • Linked from Module page & CS Module Index • See also… • Java books and online resources, e.g. "Java in a Nutshell", David Flanagan, O'Reilly & Associates, Inc. • other textbooks in the library - try a UNLOC subject search.
Topics • Concurrent (multi-threaded) programming in Java • Concurrency control in Java • Real-time threads in RTSJ • Scheduling, schedulability and resource sharing • Event-driven and asynchronous programming in Java and RTSJ • Memory management in RTSJ • Hardware interfacing in RTSJ • (Maybe: Interrupting threads, and asynchronous transfer of control in RTSJ??)
Why? • So you appreciate simple applications when you find them :-) • "Real" systems are like this. • Concurrent programming can be appropriate and useful in some applications. • Being "correct" is not always enough; something may also have to be "in time". • Computers have increasingly critical roles to play in real-world activities with important safety and reliability requirements.
What is a real-time system? • A real-time system is any information processing system which has to respond to externally generated input stimuli within a finite and specified period • the correctness depends not only on the logical result but also the time it was delivered • failure to respond is as bad as the wrong response! • The computer is a component in a larger engineering system => EMBEDDED COMPUTER SYSTEM • 99% of all processors are for the embedded systems market
Terminology • Hard real-time — systems where it is absolutely imperative that responses occur within the required deadline. E.g. Flight control systems. • Soft real-time — systems where deadlines are important but which will still function correctly if deadlines are occasionally missed. E.g. Data acquisition system. • “Real” real-time — systems which are hard real-time and which the response times are very short. E.g. Missile guidance system. • Firm real-time — systems which are soft real-time but in which there is no benefit from late delivery of service. A single system may have all hard, soft and real real-time subsystems In reality many systems will have a cost function associated with missing each deadline
A simple fluid control system Interface Pipe Input flow reading Flow meter Processing Valve Output valve angle Time Computer Burns & Wellings, http://www.cs.york.ac.uk/rts/RTSbookThirdEdition/chap1.ppt
A Production Control System Production Control System Finished Products Parts Machine Tools Manipulators Conveyor Belt Burns & Wellings, http://www.cs.york.ac.uk/rts/RTSbookThirdEdition/chap1.ppt
A Typical Embedded System Real-Time Clock Algorithms for Digital Control Engineering System Interface Remote Monitoring System Data Logging Database Data Retrieval and Display Display Devices Operator’s Console Operator Interface Real-Time Computer Burns & Wellings, http://www.cs.york.ac.uk/rts/RTSbookThirdEdition/chap1.ppt
Characteristics of a RTS • Large and complex — vary from a few hundred lines of assembler or C to 20 million lines of Ada estimated for the Space Station Freedom • Concurrent control of separate system components — devices operate in parallel in the real-world; better to model this parallelism by concurrent entities in the program
Facilities to interact with special purpose hardware — need to be able to program devices in a reliable and abstract way • Extreme reliability and safe — embedded systems typically control the environment in which they operate; failure to control can result in loss of life, damage to environment or economic loss
Guaranteed response times — we need to be able to predict with confidence the worst case response times for systems; efficiency is important but predictability is essential
Application Examples: Compiler • Correct • Not interactive • No deadlines • Typically sequential • May have safety critical impact depending on use
Application Examples: WYSIWIG Word Processor • Interactive • Timely response • Not realtime • Rarely safety critical • Additional opportunity to recover from error • May have concurrency
Application Examples: Washing machine controller • Embedded • Realtime • May have concurrency
Application Examples: Aircraft controller • Embedded • Hard realtime system • Safety critical • Plenty of concurrency
Summary • Many systems and devices include programmed computer-based elements • These typically • Exhibit concurrency • Have timeliness requirements (hard or soft) • Interface to specific hardware • Must be safe and reliable See also Burns & Welling chapter 1, Wellings chapter 1