ABDULMAJID2
ABDULMAJID2
PRACTICAL TWO
DATE OF SUBMISSION:
STUDENT’S NAME:
REG.NO:
QUESTION:
Suppose a disk has N cylinders, numbered from 0 to P. At some time, the disk arm is at cylinder X,
and there is a queue of disk access requests for cylinders R1, R2, R3, R4. Explain which Disk
scheduling algorithm should be the best to be used between the following
a) FIFO
b) CSCAN
c) SSTF
d) FSCAN
e) CLOOK
To determine the best disk scheduling algorithm, Lets analyse the situation with the following
parameters:
Requests are processed in the order they arrived: R1, R2, R3, and R4.
CSCAN moves the arm from one end of the disk to the other, servicing requests along the
way. Since the current position (53) is between R3 (23) and R1 (60), the arm would move
towards the lower end, serving R3 first. After reaching cylinder 0, the arm would jump to
cylinder 199 and move towards the higher end, serving R4, R1, and finally R2. CSCAN
ensures fairness and prevents starvation.
SSTF selects the request with the shortest seek time from the current position. In this case,
the algorithm would choose R3 (23) as the l seek time from 53. After serving R3, the arm
would move to R1 (60), then R4 (170), and finally R2 (123). SSTF aims to minimize seek
time and can provide efficient disk access in this scenario.
d) FSCAN(Fast SCAN)
FSCAN uses two separate queues: one for serving requests and another for incoming
requests. Since the disk arm is at position 50, it would first serve the requests in the serving
queue (if any), and then switch to the incoming queue. Assuming no prior requests in the
serving queue, the arm would process R1, R2, R3, and R4 sequentially. FSCAN provides
fairness and prevents starvation but introduces additional queue management
e) CLOOK
CLOOK moves the arm only in the direction it is already traveling, without scanning the
entire disk. It is efficient when the requests are concentrated in a particular region, which is
the case here, avoids unnecessary arm movement and provide good performance. In this
scenario the arm would move towards the higher end and serve R1 (60), R2 (123), R3 (23),
and finally R4 (170).
Regarding on this scenario and assuming the goal is to minimize seek time, both SSTF and
CLOOK would be good choices. SSTF selects requests based on the shortest seek time, while
CLOOK optimizes seek time by moving in the direction of the upcoming requests.