How to Calculate FCFS Disk Head Movement

1.6M views
May 8, 2018
by
Gate Smashers
YouTube video player
How to Calculate FCFS Disk Head Movement

TL;DR

FCFS services disk requests strictly in their arrival order, so total head movement is calculated by adding the absolute track difference between every consecutive position. Starting at track 50 and serving 82, 170, 43, 140, 24, 16, and 190 produces 642 track movements. The method prevents starvation, but its frequent direction changes can increase seek time and reduce performance.

Transcript

Hello friends, welcome to the Gate Smashers the topic is first come first serve in disk scheduling algorithm So here first of all I'm going to discuss with the question a disk contains 200 tracks the numbering is 0 to 199 Request queue contains the track numbers 82 170 43 140 24 16 190 This is the details or this is the list of the track numbers ... Read More

Key Insights

  • FCFS disk scheduling is an algorithm that services disk requests in the same sequence in which they enter the request queue. It does not inspect later requests to find a shorter route or reorganize the queue according to track location.
  • A disk request queue contains the track numbers associated with users' data-access requests. After memory management maps requested data to its track, the resulting track number is inserted into the queue and waits to be serviced by the read-write head.
  • The current head position is required to calculate total track movement. In the example, the head begins at track 50, which establishes the starting point before the queued requests are processed in their original arrival order.
  • The FCFS service path is 50 to 82, 170, 43, 140, 24, 16, and 190. Each destination is selected solely because it is next in the queue, even when another pending track is closer to the current position.
  • Total head movement is the sum of the positive distance between each consecutive pair of tracks. The example uses 82 minus 50, 170 minus 82, 170 minus 43, 140 minus 43, 140 minus 24, 24 minus 16, and 190 minus 16.
  • Seek time is represented in the example by the number of track movements the read-write head makes to reach requested tracks. Since movement or time cannot be negative, each distance is treated as a positive value regardless of the direction traveled.
  • The FCFS example requires 642 total track movements. The large result reflects a zigzag route with repeated direction changes, including movements from higher-numbered tracks to lower-numbered tracks and then back toward higher-numbered tracks.
  • FCFS prevents starvation because every request is eventually serviced according to its arrival position. Its limitation is performance, since it ignores nearby pending requests and can produce more movement, more direction changes, and a higher seek-time value than other scheduling approaches.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: How does FCFS disk scheduling process requests?

FCFS disk scheduling services requests in the exact order in which they arrive in the disk's request queue. The read-write head moves from its current track to the first requested track, then to the second, and continues through the queue without rearranging requests. Track proximity and travel direction do not change the service order.

Q: How do you calculate total head movement in FCFS?

Total head movement is calculated by finding the positive difference between each consecutive pair of positions, beginning with the current head position and the first request. Add all these distances together. When the head moves from a larger track number to a smaller one, reverse the subtraction order so the movement value remains positive.

Q: What is the FCFS service sequence in the example?

The read-write head starts at track 50 and then services the queued requests in this order: 82, 170, 43, 140, 24, 16, and 190. FCFS preserves that sequence exactly. The head therefore moves forward, backward, and forward again as required, creating the zigzag route shown in the explanation.

Q: Why are absolute track differences used in the calculation?

Track movement represents the distance traveled by the read-write head, so it must be expressed as a positive quantity. For example, movement from track 170 to track 43 is calculated as 170 minus 43, not 43 minus 170. The same rule applies whenever the head travels toward a lower-numbered track.

Q: What is the total FCFS head movement in the example?

The total is 642 track movements. It comes from adding the distances for the complete route: 50 to 82, 82 to 170, 170 to 43, 43 to 140, 140 to 24, 24 to 16, and 16 to 190. Every distance is positive before the values are added together.

Q: Why does FCFS disk scheduling prevent starvation?

FCFS prevents starvation because requests are serviced according to their established positions in the arrival queue. A request is not repeatedly postponed when newer or more convenient requests appear. Each queued request waits for the earlier entries to finish and then receives service when its own turn is reached.

Q: What is the main limitation of FCFS disk scheduling?

The main limitation is reduced performance caused by unnecessary head movement. FCFS does not examine pending track numbers to select nearby requests or minimize direction changes. Consequently, the head may travel back and forth across the disk, producing a larger movement count and a higher seek-time value than another ordering might produce.

Q: Why is the current read-write head position important?

The current head position identifies where the movement calculation must begin. Without it, the distance to the first request cannot be determined, so the complete total cannot be calculated. In the example, the head begins at track 50, making the first movement the distance from track 50 to track 82.

Summary & Key Takeaways

  • FCFS disk scheduling processes each input and output request in the exact sequence in which it enters the request queue. To trace its operation, mark the read-write head's current position and visit every requested track in order, without rearranging requests based on distance, direction, or proximity.

  • The example uses a disk containing tracks numbered 0 through 199, a starting head position of 50, and the request sequence 82, 170, 43, 140, 24, 16, and 190. Plotting these positions reveals a zigzag path because requests repeatedly send the head forward and backward.

  • Total track movement is found by adding the positive distance between each pair of consecutive positions. The example produces 642 movements. FCFS prevents starvation because every request retains its place in the queue, but its failure to prioritize nearby tracks can cause unnecessary direction changes and higher seek time.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Gate Smashers 📚