EC-20.2 Inside a Real-Time Operating System: Tasks, Priority and Scheduling
You can split an application into tasks with sensible priorities, explain what the scheduler does at every context switch, and apply a rate-monotonic argument to decide whether a set of periodic tasks is schedulable at all.
Before:EC-11. Data Communications and Computer NetworksEC-16. Ethics, Safety, Sustainability and Standards
This is the heart of the module. A real-time operating system is a small program that decides which piece of your code runs next and switches between them fast enough that each appears continuous. Understanding it means understanding one data structure, the task control block, and one decision, made at every tick and every interrupt return. Everything else in the kernel exists to serve that decision.
Work through these
A task, its stack, its state machine and the control block that holds them
Each task owns a stack and a small record of where it stopped, and switching between tasks means saving one set of registers and restoring another. Once that picture is clear, most of the kernel stops being mysterious and becomes bookkeeping.
NPTEL: Real Time Operating System (IIT Kharagpur) · CoursePreemptive priority scheduling, and what happens on a tick
At each timer tick and at the end of each interrupt the kernel asks whether a higher-priority task is now ready, and switches if one is. Knowing exactly when that question is asked explains almost every surprising ordering a beginner sees.
NPTEL: Real Time Operating System (IIT Kharagpur) · CourseRate-monotonic assignment, and the utilisation bound that goes with it
For independent periodic tasks, giving the shortest period the highest priority is provably the best fixed assignment, and there is a utilisation figure below which the set is guaranteed to fit. It is the one piece of theory in this module that settles an argument outright.
NPTEL: Real-Time Systems (IIT Kharagpur) · CourseEarliest deadline first, and why it is used less often than it deserves
Scheduling by whichever deadline is nearest uses the processor better than any fixed priority scheme, and degrades far worse when the system is overloaded. That trade is the reason most shipped systems still use fixed priorities.
NPTEL: Real-Time Systems (IIT Kharagpur) · CourseChoosing how many tasks to have, and what belongs in an interrupt instead
Every task costs a stack and every context switch costs time, so more tasks is not automatically better. The usual rule is that an interrupt does the least it can and hands the rest to a task, which keeps the worst-case interrupt latency short.
Measuring what the kernel itself costs on your part
Context switch time, tick handling and interrupt latency are all measurable on the actual hardware with a spare pin, and they vary by an order of magnitude between parts. A schedulability argument that ignores them is arithmetic rather than engineering.
NPTEL: Embedded System Design with ARM (IIT Kharagpur) · Course
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 4 Sept 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.