Presentation is loading. Please wait.

Presentation is loading. Please wait.

©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2.

Similar presentations


Presentation on theme: "©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2."— Presentation transcript:

1 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2

2 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 2 Process switching l The scheduler chooses the next process to be executed by the processor. This depends on a scheduling strategy which may take the process priority into account. l The resource manager allocates memory and a processor for the process to be executed. l The dispatcher takes the process from ready list, loads it onto a processor and starts execution.

3 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 3 Scheduling strategies l Non pre-emptive scheduling Once a process has been scheduled for execution, it runs to completion or until it is blocked for some reason (e.g. waiting for I/O). l Pre-emptive scheduling The execution of an executing processes may be stopped if a higher priority process requires service. l Scheduling algorithms Round-robin; Rate monotonic; Shortest deadline first.

4 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 4 Monitoring and control systems l Important class of real-time systems. l Continuously check sensors and take actions depending on sensor values. l Monitoring systems examine sensors and report their results. l Control systems take sensor values and control hardware actuators.

5 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 5 Generic architecture

6 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 6 Burglar alarm system l A system is required to monitor sensors on doors and windows to detect the presence of intruders in a building. l When a sensor indicates a break-in, the system switches on lights around the area and calls police automatically. l The system should include provision for operation without a mains power supply.

7 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 7 Burglar alarm system l Sensors Movement detectors, window sensors, door sensors; 50 window sensors, 30 door sensors and 200 movement detectors; Voltage drop sensor. l Actions When an intruder is detected, police are called automatically; Lights are switched on in rooms with active sensors; An audible alarm is switched on; The system switches automatically to backup power when a voltage drop is detected.

8 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 8 The R-T system design process l Identify stimuli and associated responses. l Define the timing constraints associated with each stimulus and response. l Allocate system functions to concurrent processes. l Design algorithms for stimulus processing and response generation. l Design a scheduling system which ensures that processes will always be scheduled to meet their deadlines.

9 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 9 Stimuli to be processed l Power failure Generated aperiodically by a circuit monitor. When received, the system must switch to backup power within 50 ms. l Intruder alarm Stimulus generated by system sensors. Response is to call the police, switch on building lights and the audible alarm.

10 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 10 Timing requirements

11 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 11 Burglar alarm system processes

12 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 12 Control systems l A burglar alarm system is primarily a monitoring system. It collects data from sensors but no real-time actuator control. l Control systems are similar but, in response to sensor values, the system sends control signals to actuators. l An example of a monitoring and control system is a system that monitors temperature and switches heaters on and off.

13 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 13 A temperature control system

14 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 14 Data acquisition systems l Collect data from sensors for subsequent processing and analysis. l Data collection processes and processing processes may have different periods and deadlines. l Data collection may be faster than processing e.g. collecting information about an explosion. l Circular or ring buffers are a mechanism for smoothing speed differences.

15 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 15 Data acquisition architecture

16 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 16 Reactor data collection l A system collects data from a set of sensors monitoring the neutron flux from a nuclear reactor. l Flux data is placed in a ring buffer for later processing. l The ring buffer is itself implemented as a concurrent process so that the collection and processing processes may be synchronized.

17 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 17 Reactor flux monitoring

18 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 18 A ring buffer

19 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 19 Mutual exclusion l Producer processes collect data and add it to the buffer. Consumer processes take data from the buffer and make elements available. l Producer and consumer processes must be mutually excluded from accessing the same element. l The buffer must stop producer processes adding information to a full buffer and consumer processes trying to take information from an empty buffer.

20 ©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 20 Key points l Monitoring and control systems poll sensors and send control signal to actuators. l Data acquisition systems are usually organised according to a producer consumer model.


Download ppt "©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 2."

Similar presentations


Ads by Google