Skip to main content

Real-time versus ordinary software and OS; data acquisition

Short answer

Real-time software must meet fixed time limits; non-real-time only needs correct results. RTOS differs from general OS in goal (deadlines vs throughput), scheduling (priority pre-emptive vs time-sharing), and predictable bounded response. A data acquisition system uses producer-consumer processes with a circular buffer to handle sensor data.

How do real time software and OS differ from non-real time software and OS? Describe data acquisition system.

Real-time software must produce correct results within fixed time limits; non-real-time software only needs correct results, and speed is a matter of convenience. The OS under them differs in the same way.

Real-time vs non-real-time software

PointReal-time softwareNon-real-time software
CorrectnessDepends on result and timingDepends on result only
DeadlinesHard or soft deadlines must be metNo strict deadlines
InputStimuli from sensors (periodic and aperiodic)Mostly user commands and files
Design modelStimulus–response, concurrent processes, state machinesMostly sequential or request-driven
PredictabilityTiming must be predictable (worst case analysed)Average performance is enough
Failure effectCan damage equipment or endanger lifeUsually inconvenience or data re-entry
ExamplePacemaker, ABS brakes, flight controlWord processor, payroll, web browser

Real-time OS vs general-purpose OS

PointRTOSGeneral-purpose OS
GoalMeet deadlines, predictabilityThroughput, fairness, user convenience
SchedulingPriority-based, pre-emptiveTime-sharing, fair share
Response timeBounded and deterministicVariable
Interrupt latencyVery low, guaranteedNot guaranteed
SizeSmall, often in ROMLarge, many features
ExamplesVxWorks, FreeRTOS, QNXWindows, standard Linux, macOS

Data acquisition system

A data acquisition system collects data from sensors, often at high speed, and processes it for later display, analysis or storage. Sensors may produce data faster than it can be processed, so the system is designed as a producer–consumer pair of concurrent processes connected by a circular (ring) buffer.

 +---------+    +----------+    +----------+    +---------+
 | Sensors |--->| Sensor   |--->| Circular |--->| Process |
 |         |    | process  |    |  buffer  |    | data    |
 +---------+    | (produce)|    |          |    |(consume)|
                +----------+    +----------+    +---------+
                                                     |
                                                     v
                                                +---------+
                                                | Display |
                                                +---------+

How it works:

  1. The sensor (producer) process reads sensor values at fixed intervals and puts them into the buffer.
  2. The processing (consumer) process takes values from the buffer, converts and analyses them, and sends results to display or storage.
  3. The buffer absorbs differences in speed between the two processes.
  4. Mutual exclusion stops producer and consumer accessing the same buffer slot at once; the producer must wait (or overwrite old data) when the buffer is full, and the consumer waits when it is empty.

Example: in a nuclear reactor, neutron flux sensors are read continuously; the readings are buffered, processed to compute the flux level, and shown on the operator's display. Other examples are weather stations and patient-monitoring systems.

✓ Answer checked by Claude Sonnet 5.5

All Software Engineering chapter 4 questions →