---
title: "Thread, multithreading and necessity"
subject: "Embedded System"
chapter: 6
key: "semester_6/embedded_system:multithreading-concept"
source: https://www.bctengineer.com/q/semester_6/embedded_system/multithreading-concept
site: BCT Engineering
---

# Thread, multithreading and necessity

Embedded System · Chapter 6: RTOS

- Asked in: 2072 Magh, 3 marks
- Video: [Introduction to Threads](https://www.youtube.com/watch?v=LOfGJcVnvAk) — Neso Academy
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/embedded_system/multithreading-concept
- Whole chapter: https://www.bctengineer.com/md/semester_6/embedded_system/chapter-6

## Question

Define thread in RTOS. Explain the concept of multi threading and why is it necessary.

## Short answer

A thread is the smallest schedulable unit with own program counter, registers, and stack, sharing code and data within a process. Multithreading runs multiple threads concurrently, enabling responsiveness (blocked threads don't halt others), better CPU utilization, cheap communication via shared memory, faster creation/switching than processes, and parallelism on multi-core systems for real-time deadline handling.

## Answer

A **thread** in an RTOS is the smallest unit of CPU scheduling: a single flow of control within a task/process, with its own program counter, registers and stack, sharing the code, data and resources of its parent task with other threads.

#### Multithreading
**Multithreading** means having several threads in one process, executing concurrently. On a single CPU the scheduler switches rapidly among them; on multiple cores they run in parallel.

```text
 Process
  +--------------------------------------+
  | code, data, files (shared)           |
  |  Thread 1   Thread 2   Thread 3      |
  |  (own stack, registers, PC each)     |
  +--------------------------------------+
```
Example: an embedded data logger has one thread reading sensors, another updating the display, and a third sending data over UART.

#### Why it is necessary
- **Responsiveness:** a blocked thread (waiting for I/O) does not stop the others, so the system stays responsive.
- **Better CPU utilisation:** while one thread waits, another uses the CPU.
- **Resource sharing:** threads share memory and data, so communication is easy and cheap.
- **Economy:** creating and switching threads is faster and needs less memory than for processes.
- **Real-time handling of concurrent events:** separate threads for different activities simplify the design and help meet deadlines.
- **Parallelism** on multi-core processors improves performance.

## Check yourself

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

1. A thread in an RTOS has its own:
   A. Code, data and files separate from other threads
   B. Address space separate from its parent task
   C. Program counter, registers and stack, while sharing code and data with its task
   D. Only its own data but shared stack
   Answer: C. Threads keep private PC, registers and stack but share the parent's code, data and resources. (Key point: Definition of thread)

2. How does multithreading work on a single CPU?
   A. All threads run truly in parallel
   B. The scheduler switches rapidly among threads, giving concurrency
   C. Only one thread may exist
   D. Threads are converted into processes
   Answer: B. On one CPU threads interleave via fast switching; true parallelism needs multiple cores. (Key point: Multithreading on one CPU)

3. Why does multithreading improve responsiveness and CPU use?
   A. While one thread waits for I/O, others keep using the CPU
   B. It removes the need for a scheduler
   C. It gives each thread separate memory
   D. It makes all threads run faster individually
   Answer: A. A blocked thread does not stop others, so the CPU stays busy and the system responsive. (Key point: Why necessary)

## Related in Embedded System

- [Multiprocessing versus multitasking](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Amultiprocessing-vs-multitasking) — Embedded System, chapter 6

## Related in other subjects

- [Process vs thread; multithreading advantages](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprocess-thread-multithreading) — Operating System, chapter 2
- [Concept of effective mass in a crystal](https://www.bctengineer.com/question.md?key=semester_3%2Felectrical_engineering_material%3Aeffective-mass-concept-crystal) — Electrical Engineering Material, chapter 1, asked 4×
- [Flange width concept in T and L beams](https://www.bctengineer.com/question.md?key=semester_7%2Fdesign_of_rcc_structure%3Aflange-width-concept-in-t-and) — Design of RCC Structure, chapter 4
