This repo contains a comprehensive project that focuses on comparing the efficiency and fairness of disk scheduling algorithms: FIFO, SSTF, Scan, and C-Scan. It involves generating disk track requests, implementing the algorithms, and analyzing their performance in terms of track traversal and request delay fairness.
- Random generation of disk track requests (0 to 99).
- Implementation of FIFO, SSTF, Scan, and C-Scan algorithms.
- Analysis of tracks traversed by the read/write arm.
- Evaluation of fairness in request processing order.
- Visualization of request delays and analysis via histograms.
- Calculation of longest and average delays for tracks.
- Programming environment for C
- Clone the repository to your local machine.
- Navigate to the project directory in your command line interface.
- Compile the program using
make
in the shell. - Execute with
./main [number_of_requests]
, where[number_of_requests]
is an integer in the range [0:99].
The input.txt
file in the directory contains the generated sequence of requests, with a new one being generated every time the program is compiled. The outputs for different request numbers are saved in output.csv
and include the total tracks traversed and delays experienced by the requests.
Further analysis of the different algorithms, along with a detailed report, can be found in analysis.md
in the repository.
Resources used:
- SSTF and C-Scan algorithm understanding: Coding Ninjas Library
- Refreshing Merge Sort: Programiz
- General C syntax questions: OpenAI Chat
- Overview of disk scheduling content & project idea gathered from the ZyBooks' Operating Systems book written by Lubomir Bic, a professor of Computer Science at the University of California, Irvine.
- ZyBook ISBN: 979-8-203-07220-7
This project was developed as an extension of a class assignment, and while it is primarily for educational purposes, contributions or suggestions for improvements are welcome. To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
Matheus K. Westphalen - [email protected]
Project Link: https://github.com/mwestphalen/disk-scheduling-algorithms