Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that implements the following disk-scheduling algorithms from chapter 9 in your text : a. FCFS b. SSTF c. SCAN d. C-SCAN e.

Write a program that implements the following disk-scheduling algorithms from chapter 9 in your text:

a. FCFS
b. SSTF
c. SCAN
d. C-SCAN
e. LOOK
f. C-LOOK

Your program will service a disk with n cylinders numbered 0 to n-1. The program will read a data file (Asg5Data.txt)found in the assignment section which has two sets of scheduling data. The first entry in the data file is the number of cylinders for your disk. The next entry is the cylinder number the disk position at the beginning of the simulation. Next, comes a line with a string of numbers representing the numbers of cylinders with I/O requests and service them according to each of the algorithms listed above. Following that is second set of this data in the file but with different values including a different number of cylinders and a different start position. Your program will output the total amount of head movement required by each algorithm. The output should consist of two sets of the following:

For FCFS, the total head movement was xxx cylinders.

For SSTF, the total head movement was xxx cylinders.

For SCAN, the total head movement was xxx cylinders.

For C-SCAN, the total head movement was xxx cylinders.

For LOOK, the total head movement was xxx cylinders.

For C-LOOK, the total head movement was xxx cylinders.

Make certain to remove or turn off any debug output before you generate the output file.

Assume the disk will move from the smaller to larger cylinder numbers for the scan and look algorithms. Do not forget to count the back to the start movement for the C-SCAN and C-LOOK algorithms.

The data in this first set is that used on pages 463 467 in your text and may be used to check some of your code. Then your program will read a second similar set of data from the same file and run that. Note that the data second set has different number of cylinders.

Make comments - do any of the algorithms look especially good or bad? How many hours did the assignment take? What did you learn from this assignment?

Asg5Data.txt file

200
53
98 183 37 122 14 124 65 67
1000
250
100 400 325 290 650 222 850 250 270 150

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago