Make your simulation run faster, Computer Engineering

Assignment Help:

Ameliorating the mechanical delays of seeks and rottion are usually regardeed as major aspects of device drivers for disks. The simplest way for a disk device driver to service disk IO requests is First Come First Served. However, most disk driver software instead uses the "elevator algorithm". If there is no IO request pending, the first request is serviced. If, however, there is at least one request pending, then the disk arm has a direction of movement: inward or outward from the ddisk spindle. Two ordered listsof pending IO requests are maintained: those that can sstill be serviced while the disk arm continues its current direction, and those that must be seerviced after the disk arm changes direction and sweeps back across the disk. IL requests are serviced in order of cylindr number, when there are no further pending IO requestts in the direction the disk arm has been moving, the disk arm reverses direction and starts servicing IO requests that had been behind it. IO requests may arrive while the arm is sweeping, and such requests are sorted into one of the two lists as appropriate.
A) To quantify the benefit of using the elevator algorithm, simulate the disk driver handling IO requests and compute the average and median service time if the requests were handled FCFS and the average and median time if the requests were handled by the elevator algorithm. Comment on the ratio between the FCFS and elevator algorithm results. 

Assume a typical modern disk has about 16000 cylkinders, that the time for the arm to seek the full width of the disk is 5 milliseconds, and that the disk rotates at 7200 rpm. but because of rotational position sensing, after seeking to the appropriate cylinder an IO request only needs to wait for otational delay from the end of where the previous IO request was serviced to the start of where the next IO request is to be serviced. Assume tht the seek time is proportional to the number of
cylinders that must be crossed from the cylinder where the previous IO request was serviced to the cylindeer where the next IO request is to be serviced. (Measurement on any real disk shows this model is incorrect, but close enough for our purpose.)
Assume that the load of IO requests arrive at exponentially distributed distributed time intervals with mean 1 millisecond, that the cylinder distribution is 25% from the swap space (and, for Unix File System, the inode space) that occupies a few cylinders in the middle of the disk but that otherwise the cylinder distribution of IO requests is uniform, and that the length of the dta transfer of an IO request is lognormal, with median 1k bytes and scale parameter 1. Simulate enough IO requests that your averages have less than 1% error.

B) One way to make your simulation run faster, expecially now that almost all personal computers have at least dual cores, would be to wrrite your program as multi-threadd. Regardless of whether you actually have access to a multi-thread environment, indicate where in your program you would have to insert concurrency control (say semaphores) in order to avoid critical races.


Related Discussions:- Make your simulation run faster

Calculate number of calls put through by a single server, A group of 20 ser...

A group of 20 servers carry traffic of 10 erlangs. If the average duration of a call is three minutes, calculate the number of calls put through by a single server and the group as

Operation codes used in assembly instructions, Q. Operation codes used in a...

Q. Operation codes used in assembly instructions? Now let's describe various operation codes needed for this machine so that we can translate High level language instructions t

Advantage and disadvantage of threaded binary trees, Advantage  1.     ...

Advantage  1.       By doing threading we neglect the recursive method of traversing a Tree , which makes use of stack and consumes many memory and time . 2.       The node

What is a subroutine, What is a subroutine? A subroutine is a named, in...

What is a subroutine? A subroutine is a named, independent section of C code that performs a particular task and optionally returns a value to the calling program.

What do you mean by segment numbers, Q. What do you mean by Segment numbers...

Q. What do you mean by Segment numbers? There is a good reason for not leaving determination of segment numbers up to assembler. It permits programs written in 8086 assembly

Computer organization, using one-address instructions,write a program to co...

using one-address instructions,write a program to compute X=A-BxC

Recursion, Ask qurecurrion for short noteestion

Ask qurecurrion for short noteestion

Return a string, Write a function that will prompt the user individually fo...

Write a function that will prompt the user individually for a filename and extension and will make and return a string with the form 'filename.ext'.

Simplify using k-map, Q. Simplify Using K-Map 1. M2 + M3 + M5 + M7 + M1...

Q. Simplify Using K-Map 1. M2 + M3 + M5 + M7 + M12 + M13 + M8 + M9 2. M0 + M2 + M4 + M5 + M8 + M10 + M12 3. F(W,X,Y,Z) = ∑ (0,1,2,4,5,6,8,9,12,13,14)

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd