0
0
Operating Systemsknowledge~10 mins

LOOK and C-LOOK variants in Operating Systems - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - LOOK and C-LOOK variants
Start at initial head position
Move head in one direction
Check for requests in that direction
Serve requests
Continue moving
For C-LOOK: jump to furthest request
Repeat until all requests served
The disk head moves in one direction serving requests until none remain, then either reverses (LOOK) or jumps back (C-LOOK) to continue.
Execution Sample
Operating Systems
Requests = [10, 22, 20, 2, 40, 6]
Head = 20
Direction = up

Serve requests in direction until none left
Then reverse (LOOK) or jump (C-LOOK)
Simulates disk head moving to serve requests in one direction, then changing direction or jumping.
Analysis Table
StepHead PositionDirectionRequests ServedAction
120up20Serve request at 20
222up22Serve request at 22
340up40Serve request at 40
440up-No more requests up, LOOK reverses direction to down
510down10Serve request at 10
66down6Serve request at 6
72down2Serve request at 2
82down-No more requests down, all served, STOP
120up20Serve request at 20 (C-LOOK start)
222up22Serve request at 22
340up40Serve request at 40
42up2Jump to lowest request 2, serve 2
56up6Serve request at 6
610up10Serve request at 10
710up-All requests served, STOP
💡 All requests served; LOOK reverses direction when no requests remain in current direction; C-LOOK jumps to lowest request after reaching highest.
State Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6After Step 7Final
Head Position202022404010622
Direction (LOOK)upupupupdowndowndowndownstop
Requests Served (LOOK)[][20][20,22][20,22,40][20,22,40][20,22,40,10][20,22,40,10,6][20,22,40,10,6,2][20,22,40,10,6,2]
Direction (C-LOOK)upupupupupupupupstop
Requests Served (C-LOOK)[][20][20,22][20,22,40][20,22,40,2][20,22,40,2,6][20,22,40,2,6,10][20,22,40,2,6,10][20,22,40,2,6,10]
Key Insights - 3 Insights
Why does LOOK reverse direction instead of jumping back?
LOOK moves the head back along the track after reaching the last request in one direction, as shown in execution_table steps 4 and 5, to serve remaining requests.
How does C-LOOK differ in handling the head movement after reaching the last request?
C-LOOK jumps directly to the lowest request without reversing, as seen in execution_table step 4 for C-LOOK, skipping empty tracks.
Why are some requests served out of numerical order in C-LOOK?
Because C-LOOK only moves in one direction and jumps back to the lowest request, it serves requests in ascending order from the jump point, not reversing direction.
Visual Quiz - 3 Questions
Test your understanding
Looking at the execution_table, what is the head position at step 3 for LOOK?
A22
B40
C10
D6
💡 Hint
Check the 'Head Position' column at step 3 in the LOOK part of the table.
At which step does LOOK reverse direction?
AStep 3
BStep 5
CStep 4
DStep 7
💡 Hint
Look at the 'Action' column where it mentions reversing direction.
In C-LOOK, after serving the highest request, what happens next?
AHead jumps to lowest request
BHead reverses direction
CHead stops
DHead moves to middle request
💡 Hint
See the action at step 4 in the C-LOOK section of the execution_table.
Concept Snapshot
LOOK and C-LOOK are disk scheduling algorithms.
LOOK moves the head in one direction serving requests until none remain, then reverses.
C-LOOK moves in one direction and jumps back to the lowest request without reversing.
Both reduce unnecessary head movement compared to SCAN.
Useful for optimizing disk access time.
Full Transcript
This visual execution shows how LOOK and C-LOOK disk scheduling algorithms work. The disk head starts at a position and moves in one direction serving requests. LOOK continues until no requests remain in that direction, then reverses to serve remaining requests. C-LOOK, instead of reversing, jumps back to the lowest request and continues moving in the same direction. The execution table traces each step, showing head position, direction, requests served, and actions taken. Variable tracking shows how head position and direction change over time. Key moments clarify why LOOK reverses and C-LOOK jumps. The quiz tests understanding of head positions and direction changes. This helps beginners see how these algorithms reduce disk head movement and improve efficiency.