I am trying to learn implementation of Disk Scheduling Algorithms (SCAN and C-SCAN) in the C language, can somebody please refer to good sources of implementations of these in the C Language or advise me on programming them on C?
Further Into:-
*Objective is to write a program to optimize disk access to read a non contiguous set of pages on disk to memory, for this, I am performing disk scheduling.
*I would want to instruct the disk on read sequence of the pages
The logic for scheduling disk requests in an efficient fashion should be considered in the domain of the disk itself! Optimizing the order you read data from disk sectors is not likely to be portable or efficient.
However, if you have a file of
npages * PAGE_SIZE, you could attempt to improve your applications performance when servicing your own internal reads from disk. Given:You could internally sort the requests by
page(and optionally coalesce neighbor pages):