---
title: "Real-time versus ordinary software and OS; data acquisition"
subject: "Software Engineering"
chapter: 4
key: "semester_5/software_engineering:real-time-vs-non-real-time"
source: https://www.bctengineer.com/q/semester_5/software_engineering/real-time-vs-non-real-time
site: BCT Engineering
---

# Real-time versus ordinary software and OS; data acquisition

Software Engineering · Chapter 4: Real-time software design

- Asked in: year not given, 4+4 marks
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/real-time-vs-non-real-time
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-4

## Question

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

## 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.

## Answer

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

| Point | Real-time software | Non-real-time software |
|---|---|---|
| Correctness | Depends on result **and** timing | Depends on result only |
| Deadlines | Hard or soft deadlines must be met | No strict deadlines |
| Input | Stimuli from sensors (periodic and aperiodic) | Mostly user commands and files |
| Design model | Stimulus–response, concurrent processes, state machines | Mostly sequential or request-driven |
| Predictability | Timing must be predictable (worst case analysed) | Average performance is enough |
| Failure effect | Can damage equipment or endanger life | Usually inconvenience or data re-entry |
| Example | Pacemaker, ABS brakes, flight control | Word processor, payroll, web browser |

#### Real-time OS vs general-purpose OS

| Point | RTOS | General-purpose OS |
|---|---|---|
| Goal | Meet deadlines, predictability | Throughput, fairness, user convenience |
| Scheduling | Priority-based, pre-emptive | Time-sharing, fair share |
| Response time | Bounded and deterministic | Variable |
| Interrupt latency | Very low, guaranteed | Not guaranteed |
| Size | Small, often in ROM | Large, many features |
| Examples | VxWorks, FreeRTOS, QNX | Windows, 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**.

```text
 +---------+    +----------+    +----------+    +---------+
 | 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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How does correctness differ between real-time and non-real-time software?
   A. Real-time depends on result and timing; non-real-time on result only
   B. Both depend on timing equally
   C. Real-time depends only on timing
   D. Non-real-time depends on timing only
   Answer: A. Real-time software must be correct and timely; non-real-time software only needs correct results. (Key point: Correctness criterion)

2. Which scheduling does an RTOS typically use?
   A. Time-sharing fair share
   B. First-come first-served only
   C. Priority-based pre-emptive
   D. Random selection
   Answer: C. RTOS uses priority-based pre-emptive scheduling to meet deadlines. (Key point: RTOS vs GPOS scheduling)

3. Why is a circular buffer used between sensor and processing processes in a data acquisition system?
   A. To slow down the sensors
   B. To store results permanently
   C. To avoid mutual exclusion
   D. To absorb speed differences between producer and consumer
   Answer: D. Sensors may produce data faster than it is processed; the buffer absorbs the speed difference. (Key point: Producer-consumer buffer)

4. What is mutual exclusion needed for in the data acquisition system?
   A. To stop producer and consumer using the same buffer slot at once
   B. To keep sensors in sync with the display
   C. To raise interrupt priority
   D. To compress data
   Answer: A. It prevents both processes accessing the same slot simultaneously, which would corrupt data. (Key point: Mutual exclusion)

## Related in Software Engineering

- [General OS versus real-time OS](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Ageneral-os-vs-rtos) — Software Engineering, chapter 4
- [Real-time system and real-time OS components](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Areal-time-os) — Software Engineering, chapter 4
- [Designing software for real-time environments](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Areal-time-design-considerations) — Software Engineering, chapter 4

## Related in other subjects

- [Embedded real-time software; model for project](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aembedded-rt-software-model) — Instrumentation II, chapter 9
- [Preemptive vs non-preemptive; real-time scheduling](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-nonpreemptive-realtime) — Operating System, chapter 2
- [Blocks of a data acquisition system](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adata-acquisition-system-blocks) — Digital Control System, chapter 1, asked 2×
- [Data acquisition system and tracking/hold modes](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adata-acquisition-tracking-hold) — Digital Control System, chapter 1
