Describe some advantages and disadvantages of FCFS and SCAN
- User
Describe some advantages and disadvantages of FCFS and SCAN
- Assistant
FCFS (First-Come, First-Served) and SCAN are two popular scheduling algorithms used in computer systems. Here are some advantages and disadvantages of each:
- User
Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 2150, and the previous request was at cylinder 1805. The queue of pending requests, in FIFO order, is 2069, 1212, 2246, 2800, 844, 1618, 1156, 1523, 4965, 2681. Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk scheduling algorithms: • First-Come-First-Serve (FCFS) • Shortest-Seek-Time-First (SSTF) • SCAN • CSCAN
- Assistant
To calculate the total distance moved by the disk arm for each disk scheduling algorithm, we start from the current head position and move through the pending requests in the given order.
-
First-Come-First-Serve (FCFS): Total distance moved = |2150 - 2069| + |2069 - 1212| + |1212 - 2246| + |2246 - 2800| + |2800 - 844| + |844 - 1618| + |1618 - 1156| + |1156 - 1523| + |1523 - 4965| + |4965 - 2681| = 81 + 857 + 1034 + 554 + 1956 + 774 + 462 + 367 + 3442 + 2284 = 12557 cylinders
-
Shortest-Seek-Time-First (SSTF): Total distance moved = |2150 - 2069| + |2069 - 2246| + |2246 - 2681| + |2681 - 2800| + |2800 - 1523| + |1523 - 1618| + |1618 - 1156| + |1156 - 1212| + |1212 - 844| + |844 - 4965| = 81 + 177 + 435 + 119 + 1277 + 95 + 462 + 56 + 368 + 4121 = 7131 cylinders
-