VOOZH about

URL: https://www.geeksforgeeks.org/software-engineering/tasks-in-real-time-systems/

⇱ Tasks in Real Time systems - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Tasks in Real Time systems

Last Updated : 20 Sep, 2025

In a Real-Time System (RTS), tasks must be executed and completed within strict timing constraints or deadlines. These systems are widely used in applications where delayed responses can cause severe consequences, such as in flight control systems, real-time monitors, medical devices and industrial automation systems.

Note: Real-time systems are designed to guarantee timely execution and their tasks are categorized based on timing characteristics and criticality.

Types of Tasks in Real-Time Systems

1. Periodic Tasks

  • Definition: Tasks that occur at regular, fixed time intervals.
  • Each periodic task is represented by a 4-tuple:

Where:

  • Phase (release time of the first job). Defaults to zero if not specified.
  • Period of the task (time interval between consecutive releases).
  • Execution time (CPU time needed to complete the job).
  • Relative deadline (time by which the job must complete).

Example: A task with period = 5 seconds and execution time = 3 seconds:

  • First job released at t = 0, executes for 3s.
  • Next job released at t = 5, executes for 3s.
  • Jobs are released at t = 5k, where k = 0, 1, 2, ...
πŸ‘ real-time
Periodic Tasks

Hyper Period:

  • The least common multiple (LCM) of periods of all periodic tasks.
  • Example:

T1 period = 4, T2 period = 5, Hyper period H = LCM(4, 5) = 20

  • After H time units, the job release pattern repeats.

2. Dynamic Tasks

  • Triggered by events (external or internal).
  • No fixed periodicity.
  • Further divided into: Aperiodic Tasks & Sporadic Tasks

Aperiodic Tasks:

  • Jobs arrive at arbitrary times (random).
  • Soft or no deadlines.

Sporadic Tasks:

  • Similar to aperiodic tasks, but with hard deadlines.
  • Represented by a 3-tuple:

Where:

  • Execution time.
  • Minimum separation between two consecutive jobs.
  • Relative deadline.

3. Critical Tasks

  • Essential tasks where missing deadlines leads to catastrophic failure.
  • Examples: Life-support systems & Flight stability control.
  • Must execute at a higher priority and with strict timing constraints.

Non-Critical Tasks

  • Real-time tasks but not safety-critical.
  • Their timely completion improves system efficiency but does not cause disasters if delayed.
  • Goal: Maximize the number of tasks completed within deadlines.

Additional Concepts in Real-Time Systems

Jitter

  • Release time of a job is not exact; only a known range:
  • Execution time is also a range:
  • Jitter accounts for variability in release and execution times.

Precedence Constraints of Jobs

  • Some jobs must execute in a specific order.
  • Precedence Relation (<):

( Ji < Jj ) -> Jj cannot start until Ji finishes.
Immediate Predecessor: No intermediary job between Ji and Jj.

Example 1

  • J1 < J2 and J1 < J5.
πŸ‘ real-time1
Example 1 (Precedence Graph Representation)

Set representation:
  < (1) = { }
  < (2) = {1}
  < (3) = { }
  < (4) = { }
  < (5) = {1}

Example 2

  • Given a directed graph where: J1 -> J2 -> J3 -> J4 and J2 -> J4
πŸ‘ real-time-2
Example 2 (Precedence Graph Representation)

Precedence Constraints:

  • J1 < J2
  • J2 < J3
  • J2 < J4
  • J3 < J4

Note: Representation as a directed graph helps visualize and manage dependencies between jobs.

Comment
Article Tags:

Explore