Disk Scheduling Algorithm Simulator

Enter a request queue, head position and direction to see the head movement chart, the order of service and total seek distance for six algorithms, compared in one table.

S'executa al teu navegador. Els fitxers mai no surten del dispositiu. Mira com comprovar-ho

…

Com es fa

  1. 1
    Enter the queue

    Type the requested cylinders separated by spaces or commas.

  2. 2
    Set head and disk

    Enter the head position and the last cylinder number.

  3. 3
    Choose the direction

    Press Moving up or Moving down for the elevator algorithms.

  4. 4
    Pick an algorithm

    Press FCFS, SSTF, SCAN, CSCAN, LOOK or CLOOK and read the chart and the moves.

  5. 5
    Compare

    Open Compare all six to see every algorithm's order and total.

  6. 6
    Practise and export

    Answer generated questions, export a CSV or print the comparison.

Sobre aquesta eina

On a hard disk the read-write head has to move across the platter to reach each requested cylinder, and that movement is slow compared with everything else in the computer. Disk scheduling algorithms choose the order in which pending requests are served to reduce total head movement. They are a standard operating-systems exam topic: given a queue of cylinder numbers, the head position and the direction, draw the head path and add up the distance. This simulator does it for FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK, draws the movement chart that textbooks use, writes each move with its distance and compares all six algorithms on the same queue, showing C-SCAN and C-LOOK totals with and without the return jump.

The algorithms

- **FCFS** serves requests in arrival order. Fair but often zig-zags across the disk. - **SSTF** always serves the closest pending request. It reduces movement but can starve requests far from the head. - **SCAN (elevator)** sweeps in one direction to the end of the disk serving requests, then reverses. - **C-SCAN** sweeps in one direction to the end, returns to the other end without serving and sweeps again in the same direction, giving more uniform waiting times. - **LOOK** is SCAN that turns around at the last request instead of the disk edge. - **C-LOOK** is C-SCAN that only goes as far as the last request before jumping back to the lowest pending request.

Direction and the return jump

SCAN, C-SCAN, LOOK and C-LOOK need to know which way the head is moving; set it with the Moving up and Moving down buttons. Textbooks disagree on whether the return jump of C-SCAN and C-LOOK counts as head movement: some count it because the arm really moves, others leave it out because no requests are served. The simulator shows both figures.

Reading the chart

The horizontal axis shows cylinder numbers from 0 to the last cylinder and each row is one step in time. The line joins the cylinders in service order, the same diagram drawn in exam answers. The steps list each move as from → to with its distance, ending with the total.

Worked example

Queue 98, 183, 37, 122, 14, 124, 65, 67 with the head at 53 on a disk of cylinders 0-199. FCFS moves 640 cylinders. SSTF serves 65, 67, 37, 14, 98, 122, 124, 183 for 236. SCAN moving towards 0 goes 37, 14, 0, then 65 up to 183, also 236. LOOK moving up serves 65 to 183 and then 37 and 14, totalling 299.

Limits

The model counts cylinder distance only. Real drives also have rotational latency, and their controllers reorder requests internally; solid-state drives have no moving head at all, so these algorithms matter much less there. The simulator is for learning the classic algorithms, not for tuning real storage systems.

Exemple resolt

Head 53, queue 98 183 37 122 14 124 65 67: FCFS 640, SSTF 236, SCAN (down) 236, LOOK (up) 299.

En resum

Preguntes freqüents

What is the difference between SCAN and LOOK?

SCAN travels all the way to the end of the disk before reversing; LOOK reverses at the last request in that direction.

Why can SSTF cause starvation?

If new requests keep arriving near the head, a request far away may be postponed again and again.

Should I count the C-SCAN return jump?

Follow your course. The simulator gives the total with the jump and the figure without it.

Which algorithm is best?

It depends on the load. SSTF and LOOK usually give low totals; C-SCAN and C-LOOK give more even waiting times under heavy load.

Do these algorithms apply to SSDs?

Hardly. SSDs have no moving head, so seek order matters little; these algorithms are about hard disks.

Can I change the disk size?

Yes. Set the last cylinder number; requests outside the range are ignored.

Totalment gratisSense cost, sense registre
Els fitxers es mantenen privatsTot funciona al teu navegador
Fàcil en el teu idiomaDisponible en molts idiomes