Process Scheduler Benchmarking

This program demonstrates the use of Linux's scheduling policies for different processes. It creates three child processes, each of which performs a counting task. The goal is to benchmark these processes based on different scheduling policies and priorities. The execution times for each process are measured, and the results are displayed in a histogram.

Table of Contents

  1. Introduction
  2. How to Run the Application
  3. Process Descriptions
  4. Compilation and Execution
  5. Error Handling
  6. Conclusion
  7. Contributors

Introduction

This program creates three child processes and assigns them different scheduling policies and priorities. Each child process performs a counting task from 1 to 232. The parent process measures the execution times of these child processes and displays the results in a histogram.

How to Run the Application

  1. Prequisites:

    • Linux based OS.
    • GCC compiler on the system.
    • Linux-header files on the system.
  2. Cloning the Repository:

  3. Opening the Project:

    • Unzip the file.
    • Right-click on the screen and select "Go to terminal here" (or any other similar option).
  4. Compilation:

    • Compile the program using the provided Makefile:
      make all
  5. Execution:

    • Run the program using the following command:
      make run
  6. View Results:

    • After execution, the program generates a histogram to compare the execution times of processes with different scheduling policies.
    • The histogram is displayed using Python and Matplotlib. Error
  7. Delete executables:

    • Delete the executables using the following:
      make clean

Process Descriptions

  1. Process 1 (SCHED_OTHER):

    • This process uses the SCHED_OTHER scheduling policy with standard priority (nice: 0).
  2. Process 2 (SCHED_RR):

    • This process uses the SCHED_RR scheduling policy with default priority.
  3. Process 3 (SCHED_FIFO):

    • This process uses the SCHED_FIFO scheduling policy with default priority.

Compilation and Execution

The program is compiled using the provided Makefile, and the a.out executable is generated. taskset has been used to ensure that the program runs only on 1 processor - processor number 3.

Error Handling

The program includes error handling for various scenarios, such as failed fork() operations. Error messages are printed to stderr in case of errors.

Conclusion

This program demonstrates the use of different scheduling policies in Linux for managing and benchmarking processes. By comparing the execution times of processes with different scheduling policies, it provides insights into process scheduling in the Linux operating system.



Contributors

Feel free to reach to any of us at sanyam22448@iiitd.ac.in or yash22586@iiitd.ac.in for any questions or issues related to the above assignment.