This piece of code simulates the behavior of following disk scheduling algorithms:
- FCFS (First Come First Served)
- SSTF (Shortest Seek Time First)
- LOOK
- CLOOK
For a given set of disk requests, total time, average waiting time and standard deviation of waiting time is outputted.
- GCC 4.5 or later (Supports C99)
- GNU make
Build by:
$ make
Run on input:
$ ./ds <num_of_disk_requests> <input_filename>
The input should be given as rows of <request_arrival_time> <request_cylinder>
pairs, each row separated by an EOL character.
Input
Output
Ending lines at the output shows name of the algorithm, total time required for all requests to be handled, average waiting time, and standard deviation of waiting times.
Written together with Buğra Aydın