Skip to content

HoussemLahmar/Adaptive-Real-Time-Scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Adaptive Real-Time Scheduler for Embedded Systems

A reimplementation of the adaptive real-time scheduler described in the research paper "Adaptive Real-Time Scheduler for Embedded Operating System" (2nd Indian International Conference on Industrial Engineering and Operations Management, 2022). Enhanced with modular code structure, dynamic process management, and comprehensive performance metrics.


πŸ“œ Project Overview

This scheduler combines multi-level priority queues with round-robin scheduling to optimize CPU utilization and energy efficiency in embedded systems. It dynamically adjusts task execution based on process priorities and incorporates three-tier queue management.

System Architecture

Multilevel Feedback Queue Demonstration
Figure 1: Multilevel Feedback Queue Structure (Priority-based tiers with dynamic time quanta)

Adaptive Scheduler Workflow
Figure 2: Adaptive Scheduling Logic with Decision Module

Key Features:

  • 3-tier priority queues (High/Medium/Low with ranges 100-150, 50-100, 0-50)
  • Adaptive time quanta (3/2/1 units per queue)
  • Sleep function integration for low-priority tasks (energy optimization)
  • Circular linked list implementation for efficient process management
  • Interactive CLI for process input and scheduling
  • Performance metrics: Average waiting time, turnaround time, and completion tracking

πŸ“₯ Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/adaptive-real-time-scheduler.git
    cd adaptive-real-time-scheduler
  2. Compile the code (requires GCC):
    gcc adaptive_scheduler.c -o scheduler

πŸš€ Usage

Run the executable and follow the interactive menu:

./scheduler

Menu Options:

  1. Add Processes: Input PID, priority, arrival time, and burst time.
  2. Run Scheduler: Execute processes across priority queues (Q1 > Q2 > Q3).
  3. Show Results: Display completion times, waiting times, and averages.
  4. Reset: Clear all queues and results.
  5. Exit: Terminate the program.

Example Input (from the research paper):

Process 1: PID=101, Priority=110, Arrival=0, Burst=10
Process 2: PID=102, Priority=120, Arrival=1, Burst=15
Process 3: PID=103, Priority=80, Arrival=2, Burst=20
Process 4: PID=104, Priority=71, Arrival=3, Burst=10
Process 5: PID=105, Priority=10, Arrival=4, Burst=25
Process 6: PID=106, Priority=15, Arrival=5, Burst=16

πŸ“Š Results

The scheduler outputs:

  • Completion Time: When each process finishes.
  • Waiting Time: Total time spent waiting in queues.
  • Turnaround Time: Total time from arrival to completion.

Example Output (matches paper's Table 1):

PID     Arrival      Burst      Completion    Waiting
----------------------------------------------------
101     0            10         21            11
102     1            15         27            11
104     3            10         45            32
103     2            20         57            35
106     5            16         150           129
105     4            25         180           151

Average Waiting Time: 61.00
Average Turnaround Time: 80.00

πŸ“– References


πŸ› οΈ Limitations & Future Work

  • Sleep Function: The energy-saving sleep() feature described in the paper is not yet implemented.
  • Preemption: Current implementation assumes non-preemptive scheduling within queues.
  • Metrics: CPU utilization calculation can be added for deeper analysis.
  • Dynamic Priorities: Support for priority adjustments during runtime.

Reimplemented by: Houssem-eddine LAHMER
Contact: houssemeddine.lahmer@outlook.com

About

Adaptive Real-Time Scheduler for Embedded Systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages