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.
- Introduction
- How to Run the Application
- Process Descriptions
- Compilation and Execution
- Error Handling
- Conclusion
- Contributors
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.
-
Prequisites:
- Linux based OS.
- GCC compiler on the system.
- Linux-header files on the system.
-
Cloning the Repository:
- Clone the repository to your local machine using the following command:
OR
git clone https://github.com/regular-life/Process-Scheduler-Benchmarking
- Download the .zip file from https://github.com/regular-life/Process-Scheduler-Benchmarking.
- Clone the repository to your local machine using the following command:
-
Opening the Project:
- Unzip the file.
- Right-click on the screen and select "Go to terminal here" (or any other similar option).
-
Compilation:
- Compile the program using the provided Makefile:
make all
- Compile the program using the provided Makefile:
-
Execution:
- Run the program using the following command:
make run
- Run the program using the following command:
-
View Results:
-
Delete executables:
- Delete the executables using the following:
make clean
- Delete the executables using the following:
-
Process 1 (SCHED_OTHER):
- This process uses the
SCHED_OTHER
scheduling policy with standard priority(nice: 0)
.
- This process uses the
-
Process 2 (SCHED_RR):
- This process uses the
SCHED_RR
scheduling policy with default priority.
- This process uses the
-
Process 3 (SCHED_FIFO):
- This process uses the
SCHED_FIFO
scheduling policy with default priority.
- This process uses the
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.
The program includes error handling for various scenarios, such as failed fork()
operations. Error messages are printed to stderr
in case of errors.
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.
- Yash Bhardwaj - GitHub Profile
- Sanyam Garg - GitHub Profile
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.