Question

I/O Scheduling Algorithms a) For each of the following scheduling algorithms, give a 1-2 sentence description...

I/O Scheduling Algorithms

a) For each of the following scheduling algorithms, give a 1-2 sentence description of how it works. The description should be precise enough to distinguish each algorithm from the others. Algorithms: FCFS, SSTF, SCAN, C-SCAN, C-LOOK. (1 point)

b) Given a hard disk with 200 cylinders and a queue with jobs having the following cylinder requests: 80, 190, 70, 130, 30, draw a diagram of the movements of the head for each of the algorithms listed in part a) above. Assume the head is initially at cylinder 120 for each algorithm. Calculate the total movement of the head.   There are diagrams provided at the end of the assignment for you to use. For SCAN, C-SCAN, and C-LOOK assume that, at the point the requests above begin, the disk arm has been moving from smallest cylinder number to largest. Also, for C-SCAN and C-LOOK, do not count the ‘jump’.. (2 points each for a total 10 points)

c) Which algorithm gave the best result? Worst? Did you expect these results? Explain. (1 point)  Could you have gotten different best or worst results with a different ordering of these same cylinder requests? Note: ‘Different’ meaning that the algorithm with the best or worst results in now changed? If ‘yes’, give an example with algorithm results. If ‘no’, justify your answer.)

      0                                                                                                                                                                  199

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

FCFS:

First Come First Serve is the simplest Disk Scheduling algorithm.

It services the IO requests in the order in which they arrive. There is no starvation in this algorithm, every request is serviced. for ex:

if the original order is 10, 8, 2 then the scheduling order will be 10, 8, 2.

SSTF:

Shortest Seek time first algorithm will schedule with respect to shortest distance from the current position.

Selects the disk I/O request which requires the least disk arm movement from its current position.

If the cursor is at 7, the original order is 10, 8, 2 then the scheduling order will be 8, 10, 2.

SCAN:

In SCAN algorithm, the scheduling will be in one direction from cursor till the end is reached and satisfies all requests in the path, then reverses the direction and satisfies all requests in path till end.

If the cursor is at 7, the original order is 10, 8, 2 then the scheduling order will be 2, 8, 10.

C-SCAN:

In SCAN algorithm, the scheduling will be in one direction from cursor till the end is reached and satisfies all requests in the path, then reverses the direction and reaches the end without serving any requests and serves the remaining requests.

If the cursor is at 7, the original order is 10, 8, 2 then the scheduling order will be 2, 10, 8.

C-LOOK:

It is similar to C-SCAN algorithm but the difference is when going in one direction the scheduling stops if there are no further request in that direction and reverses direction and cursor moves to the last request in that direction, processes the remaining requests.

b)

FCFS:

total distance = (120-80)+(190-80)+(190-70)+(130-70)+(130-30)

total distance = 430

SSTF:

least disk arm movement from 120 is 130, distance = 10

least disk arm movement from 130 is 80, distance = 50

least disk arm movement from 80 is 70, distance = 10

least disk arm movement from 70 is 30, distance = 40

least disk arm movement from 30 is 190, distance = 160

total distance = 10+50+10+40+160 = 270

total distance = 270

SCAN:

Now in the given problem the current head position is at 120,

assume we move left i.e towards 0

then the requests order will be: 80,70,30,0

then reverses the direction and order is: 130,190,200

total distance = (120-80)+(80-70)+(70-30)+(30-0)+130+(190-130) +10= 320

total distance = 320.skipping jump =>total distance = 320-130 = 190.

C-SCAN:

Now in the given problem the current head position is at 120,

assume we move left i.e towards 0

then the requests order will be: 80,70,30,0

then reverses the direction and order is: 200,190,130

total distance = (120-80)+(80-70)+(70-30)+(30-0)+200+(200-190)+(190-130) = 390

total distance = 390.skipping jump =>total distance = 390-200 = 190.

C-LOOK:

Now in the given problem the current head position is at 120,

assume we move left i.e inwards

then the requests order will be: 80,70,30

then reverses the direction and order is: 190,130

total distance = (120-80)+(80-70)+(70-30)+(190-30)+(190-130) = 310

total distance = 310.skipping jump =>total distance = 310-160 = 150.

c)

the best algorithm is SSTF the distance traveled is 270.

the worst result is from FCFS scheduling. distance traveled = 430

because while following SSTF the seek time is calculated before and will optimize the scheduling.

when following FCFS the scheduling is in original order no optimisation of scheduling and hence takes long time or travels more distance.

yes for other order we would have got different best and worst situations:

ex: 30,70,80,130,190

the best case will be using FCFS , total distance = 40+10+50+60+90 = 250.

the worst case will be using C-SCAN, total distance = 390(same as in question b).

Add a comment
Know the answer?
Add Answer to:
I/O Scheduling Algorithms a) For each of the following scheduling algorithms, give a 1-2 sentence description...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use any language Task two Write a program that implements the following disk-scheduling algorithms: a. FCFS...

    Use any language Task two Write a program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN d. C-SCAN e.LOOK f. C-LOOK Your program will service a disk with 500 cylinders numbered 0 to 499. The program will generate a random series of 20 cylinder requests and service them according to each of the algorithms listed above. The proram will be passed the initial position of the disk head (as a parameter on the command line) and...

  • Write a java program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN...

    Write a java program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN Your program will service a disk with 5000 cylinders numbered 0 to 4999. The program will generate a random series of 1,000 cylinder requests and service them according to each of nth algorithms listed above. The program will be passed the initial position of the disk head and report the total amount of head movement required by the algorithm.

  • Write a  program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN d. C-SCAN Your program will service a disk with 5,000 cylinders numbered 0 to 4,999. The program will...

    Write a  program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN d. C-SCAN Your program will service a disk with 5,000 cylinders numbered 0 to 4,999. The program will be passed the initial position of the disk head (as a parameter on the command line) and report the total amount of head movement and total number of change of direction required by each algorithm under each of the following cases: a)The program will generate a random...

  • Suppose that a disk drive has 10,000 cylinders, numbered 0 to 10,000. The drive is currently...

    Suppose that a disk drive has 10,000 cylinders, numbered 0 to 10,000. The drive is currently serving a request at cylinder 7,423 and the previous request was at cylinder 8213. The queue of pending requests, in FIFO order, is: 9324, 6324, 7232, 1304, 5621, 105, 5382, 3241, 2425, 9891. 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?...

  • 1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is...

    1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is currently serving a request at cylinder 2,150, and the previous request was at cylinder 1,805. The queue of pending requests, in FIFO order, is: 2,069 1,212 2,296 2,800 544 1,618 356 1,523 4,956 3,681 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...

  • Suppose that a disk drive has 6,000 cylinders, numbered 0 to 5999. The drive is currently...

    Suppose that a disk drive has 6,000 cylinders, numbered 0 to 5999. The drive is currently serving a request at cylinder 3150, and the previous request was at cylinder 1805 (Hint: this indicates the reading head’s moving direction). The queue of pending requests, in FIFO order, is: 3511, 2332, 2800, 3192, 658, 1296, 1918, 1356, 5936, 2527 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending...

  • *** SIMPLE C PROGRAM WILL RATE GOOD**** PLEASE LEAVE COMMENTS THROUGHOUT THE CODE SO I CAN...

    *** SIMPLE C PROGRAM WILL RATE GOOD**** PLEASE LEAVE COMMENTS THROUGHOUT THE CODE SO I CAN SEE WHAT IS HAPPENING AND LEARN, THANK YOU! Write a program that implements the following disk-scheduling algorithms: a. FCFS b. SSTF c. SCAN d. C-SCAN e. LOOK f. C-LOOK Your program will service a disk with 5,000 cylinders numbered 0 to 4,999. The program will generate a random series of 1,000 cylinder requests and service them according to each of the algorithms listed above....

  • 8.) [12 pts.] Suppose that a disk drive is currently serving a request at cylinder 1010,...

    8.) [12 pts.] Suppose that a disk drive is currently serving a request at cylinder 1010, the previous red cylinder 1000. The queue of pending requests, in FIFO order, is: drive has 2,000 cylinders, numbered O to 1,999. The 1010, 1310, 1950, 800, 200, 750, 1000 Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisty all the pending requests for each of the following disk scheduling algorithms a.) FCFS...

  • I need a full solution to this question. ( Operating Systems ) First Image: Second Image:...

    I need a full solution to this question. ( Operating Systems ) First Image: Second Image: Third Image: Fourth Image: thank you. Suppose that a disk has 5000 cylinders, numbered 0 to 1999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 152. The queue of pending requests is as follows: 130, 1750 1022, 1509, 948, 1774, 913, 1470, 86 Starting from the current head position, what is total "seek time" for...

  • Suppose a disk system has 200 cylinders, numbered 0 to 199. Assume that the read /...

    Suppose a disk system has 200 cylinders, numbered 0 to 199. Assume that the read / write head is at cylinder 63. Determine the order of head movement for each algorithm to satisfy the following stream of requests received in the following order: Queue:   100, 175, 51, 133, 8, 140, 73, 77 Head: 63 Draw head movement for Shortest Seek Time First (SSTF) algorithm. [1]

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT