Skip to content

πŸš€ Multi-Level Queue Scheduling Algorithm implementing Round Robin, Priority Scheduling, and FCFS to efficiently manage process execution based on priority levels. Includes Docker automation for easy deployment.

Notifications You must be signed in to change notification settings

harmeshgv/multi-level-queue-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Here's the updated README with the cloning instructions included.


Multi-Level Queue Scheduling Algorithm

Overview

This project implements a Multi-Level Queue Scheduling Algorithm that categorizes processes into three priority queues:

  1. High Priority Queue (Round Robin Scheduling) - Uses a time quantum of 4 units.
  2. Medium Priority Queue (Priority Scheduling) - Executes based on priority order.
  3. Low Priority Queue (First Come First Serve - FCFS Scheduling) - Executes in the order they arrive.

Features

  • Classifies processes into different priority levels based on user input.
  • Applies different scheduling algorithms to each priority queue.
  • Efficient execution of processes based on priority.

How It Works

1. User Inputs:

  • Number of processes.
  • Process ID, Priority (1-10), and Burst Time for each process.

2. Process Categorization:

  • High Priority (1-3) β†’ Round Robin Scheduling.
  • Medium Priority (4-7) β†’ Priority Scheduling.
  • Low Priority (8-10) β†’ First Come First Serve (FCFS).

3. Execution of Queues:

  • High Priority Queue (Round Robin): Each process gets a time quantum of 4. If a process has remaining burst time, it gets another turn in the next cycle.
  • Medium Priority Queue (Priority Scheduling): Processes execute in ascending order of priority.
  • Low Priority Queue (FCFS): Processes execute in the order they arrive.

Example Run

Enter the number of Processes: 3
Enter Process Id: 101
Enter Priority for the Process: 2
Enter Burst Time for the process: 10
Enter Process Id: 102
Enter Priority for the Process: 5
Enter Burst Time for the process: 7
Enter Process Id: 103
Enter Priority for the Process: 8
Enter Burst Time for the process: 12

Output:

High Priority Queue (Round Robin):
Process ID: 101, Burst Time (before): 10
Subtracting 4 from Process ID: 101, Burst Time (after): 6
Process ID: 101, Burst Time (before): 6
Subtracting 4 from Process ID: 101, Burst Time (after): 2
Process ID: 101, Burst Time (before): 2
Process ID: 101, Burst Time (after): 0

Medium Priority Queue (Priority Scheduling):
Process ID: 102, Burst Time: 7

Low Priority Queue (First Come First Serve):
Process ID: 103, Burst Time: 12

How to Run the Program

Step 1: Clone the Repository

To get started, clone this repository using Git:

git clone https://github.com/harmeshgv/MultiLevelQueueScheduling.git
cd MultiLevelQueueScheduling

Option 1: Run Manually

Requirements:

  • C Compiler (GCC for Linux/macOS, MinGW for Windows)

Steps:

  1. Compile the code:
    gcc multi_level_queue.c -o scheduler
  2. Run the program:
    ./scheduler
  3. Follow prompts to enter process details and observe the scheduling output.

Option 2: Automate with Docker

Requirements:

Steps to Build and Run Using Docker

  1. Build the Docker Image
    Run the following command inside the project directory:

    docker build -t scheduler-app .
  2. Run the Container
    Execute the following command to run the scheduler inside a Docker container:

    docker run -it scheduler-app

    The -it flag allows interactive input, so you can enter process details when prompted.


Concepts Used

1. Round Robin Scheduling (High Priority)

  • Each process gets a fixed time slot (quantum).
  • If a process isn't finished within its quantum, it goes back in the queue.
  • Ensures fair CPU time distribution.

2. Priority Scheduling (Medium Priority)

  • Executes processes based on priority (ascending order).
  • Higher priority (lower number) gets executed first.

3. First Come First Serve (FCFS) (Low Priority)

  • Executes processes in the order they arrive.
  • Simple but can lead to long waiting times for later processes.

Future Enhancements

  • Dynamic priority adjustment based on execution.
  • Multi-threading implementation for real-time scheduling.
  • Visualization tool for scheduling process execution.

Author


License

This project is open-source under the MIT License.


This README now includes cloning instructions so users can quickly set up and run the project. πŸš€

About

πŸš€ Multi-Level Queue Scheduling Algorithm implementing Round Robin, Priority Scheduling, and FCFS to efficiently manage process execution based on priority levels. Includes Docker automation for easy deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published