Dulranga's Notes
Semester 3Operating Systems

Real Time Operating Systems

In real-time systems theory, we distinguish two things:

  • Task - the recurring work to be done (e.g., "read the sensor every 10 ms").
  • Job (or instance) - one single execution of that task.

Key timing parameters of a job

ParameterSymbolMeaning
Release timerThe moment the job becomes available and ready to run (also called arrival time).
Processing time (execution time)CHow much CPU time the job needs to complete.
DeadlineDThe time by which the job must finish.
Completion timefWhen it actually finishes.
Response timeRf − r (how long from release to finish).
 release(r)                                    deadline(D)
    │                                              │
    ▼                                              ▼
────┼──────────────────────────────────────────────┼────────► time
    └────────────── execution (C) ─────────────────┘

Release Rate

  • How many jobs arrive per unit of time?
release rate=1T\boxed{\text{release rate} = \frac{1}{T}}

In a real time system,

CPU Utilization (U)=CT=C×release rate\text{CPU Utilization (U)} = \frac{C}{T} = C \times \text{release rate}
  • CC - Processing time

U = 2 ms × 100 jobs/s = 0.2 = 20% of one CPU.

Basically, if the processor has 10ms\text{10ms} period and task uses 2ms\text{2ms} to run, 20%20\% of CPU is utilized and other tasks are able to run. Otherwise if 10ms taken by the task, not any other tasks are able to run.

Rate-Monotonic Scheduling (RMS)

Assign priorities by period: the shorter the period, the higher the priority.

shorter period⇒higher rate=1T⇒higher priority\text{shorter period} \Rightarrow \text{higher rate} = \frac{1}{T} \Rightarrow \text{higher priority}

On this page