You are to implement different io-schedulers in c or c and


Programming Assignment Lab: IO Scheduling

You are to implement different IO-schedulers in C or C++ and submit the source code, which we will compile and run. Please provide a Make file so we can run on energon (and please at least test there as well).

In this lab you will implement/simulate the scheduling of IO operations. Applications submit their IO requests to the IO subsystem, where they are maintained in an IO-queue. The IO-scheduler then selects a request from the IO-queue and submits it to the disk. On completion another request can be taken from the IO-queue and submitted to the disk. The scheduling policies will allow for some optimization as to reduce disk head movement or overall wait time in the system. The schedulers to be implemented are FIFO (i), SSTF (j), SCAN (s), CSCAN (c), and FSCAN (f) (the letters in bracket define which parameter must be given in the -s program flag).

Note: when we say [C|F|]SCAN we actually mean the LOOK variant algorithm version which does not scan the entire width of the of the disk. This is the common usage in the industry of the term SCAN. Also remember that when switching queues in FSCAN you always scan up first from the current position, then down until queue empty.

Invocation is a follows:

./iosched -s

The input file is structured as follows: Lines starting with '#' are comment lines and should be ignored.

Any other line describes an IO operation where the 1st integer is the time step at which the IO operation is issued and the 2nd integer is the track that is accesses. Since IO operation latencies are largely dictated by seek delay (i.e. moving the head to the correct track), we ignore rotational and transfer delays for simplicity. Move by one track takes one time unit.

We assume that moving the head by one track will cost one time unit. As a result your simulation can/should be done using integers. The disk can only consume/process one IO request at a time. Everything else must be maintained in an IO queue and managed according to the scheduling policy. The initial direction of the SCAN algorithms is from 0-tracks to higher tracks. The head is initially positioned at track=0 at time=0. Note maxtrack is not an issue here (think why).

You can make the following assumptions:

- at most 1000 io operations will be tested, so it's OK to first read all requests from the file before processing.

You don't have to use discrete event simulation. You can write a loop that increments simulation time by one and check whether any action is to be taken, i.e. whether an I/O completed or whether and I/O arrived and whether the track has to be moved by one (i.e. there is an active I/O ongoing).

Attachment:- Lab Assignment.rar

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: You are to implement different io-schedulers in c or c and
Reference No:- TGS01702052

Expected delivery within 24 Hours