Professional Documents
Culture Documents
Real-time
control system
Sensor Actuator
Stimulus Response
Card
inserted
into reader Reading Initialising
do: get C
C do: initialise
details display
Nozzle trigger on
Resetting Stopped
do: display C
error
Paying
Payment ack. Hose in
do: debit
CC account holster
14
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 15 Slide 15
Operating system components
● Real-time clock
• Provides information for process scheduling.
● Interrupt handler
• Manages aperiodic requests for service.
● Scheduler
• Chooses the next process to be run.
● Resource manager
• Allocates memory and processor resources.
● Dispatcher
• Starts process execution.
Real-time Interrupt
Scheduler
clock handler
Process er source
requirements
Processes Available
Resource
awaiting resource
manager
resources list
Ready Released
processes resources
Ready Processor
Despatcher
list list
Executing process
Testing
process
P (A1) A1
S1 P (S1)
Monitoring
processes P (A2) A2
S2 P (S2)
P (A1) A3
Control
S3 P (S1) processes
P (A4) A4
Control panel
processes
Detector sta
tus Sensor status Sensor status
Power failure
Room number
interrupt Building monitor
Room number
Alarm system Alarm system Alarm system
Room number
Audible alarm Lighting contr
ol Voice synthesis
er
process process process
BuildingMonitor()
{
// initialise all the sensors and start the processes
siren.start () ; lights.start () ;
synthesizer.start () ; windows.start () ;
doors.start () ; movements.start () ; pm.start () ;
}
} // run
} //BuildingMonitor
Sensor
process
Sensor
500 Hz values
Thermostat
process
Switch command
500 Hz Room number Thermostat process
Sensors (each da
ta flow is a sensor a
vlue)
Sensor Sensor
s1 identifier and identifier and
value value
Sensor Sensor data Process
s2 Display
process buffer data
s3
Sensor Sensor
s4
identifier and identifier and
value value
s5 Sensor Sensor data Process
process buffer data
s6
Producer
process
Consumer
process
CircularBuffer (int n) {
bufsize = n ;
store = new SensorRecord [bufsize] ;
} // CircularBuffer