Compute the average waiting time and average response time

Assignment Help Computer Engineering
Reference no: EM131842829

ASSIGNMENT

Exercise I

There are three processes in the scheduling queue and assume that all three of them are ready to run. Assume that P1 arrived a little before P2; and P2 arrived a little before P3. Scheduling starts at time t = 0. The CPU and I/O burst patterns of the three processes are as shown below:

Given the following processes that arrived in the order shown

 

CPU Burst Time

IO Burst Time

CPU Burst Time

IO Burst Time

CPU Burst Time

P1

4

2

4

2

4

P2

5

2

5

 

 

P3

2

2

2

2

2

Each process exits the system once its CPU and I/O bursts as shown above are complete.
Show the activity in the processor and the I/O area using the FCFS, SJF, and Round Robin (time quantum = 2) algorithms

For each algorithm, compute the average waiting time, the average response time, and the throughput.

Exercise II

Recall that Shortest Remaining Job First (SRJF) is a variant of Shortest Job First (SJF) with preemption added in. Consider the following three processes vying for the CPU. The scheduler uses SRJF. The scheduler re-evaluates which process to run only upon the arrival of a new process into the scheduling queue, or the completion of a process. The table shows the arrival time of each process.

Process

Arrival Time

Execution Time

P1

To

5 ms

P2

To + 2 ms

4 ms

P3

To + 3 ms

1 ms

The scheduling starts at time To.

Fill in the table below with the process that is executing on the processor during each time slot. Be sure to show your work as to how you arrived at schedule.

To+

0

1

2

3

4

5

6

7

8

9

10

11

12

Running

 

 

 

 

 

 

 

 

 

 

 

 

 

SIMULATION ASSIGNMENT: Process Scheduling Simulator

Text Book- Operating Systems: Internals and Design Principles by William Stallings, Sixth Edition, ISBN-10: 0-13-600632-9 ISBN-13: 978-0-13-600632-9.

I. Overview

The Process Scheduling Simulator will execute a collection of processes that demonstrate a scheduling algorithm of either First-Come/First-Served (FCFS), Shortest Job First (SJF), Preemptive Shortest Job First (PSJF), Shortest Job First Approximation (SJFA), or Round Robin (RR) and will then generate visual aids along with statistics to explain the results.

II. Setup

i. Windows XP/Vista

1. Right click on the downloaded zip file containing the simulator and choose extract all.
2. Choose Next till the wizard has finished.
3. Navigate to the directory named 'ps' which contains the unzipped simulator.
4. Edit 'psconfig' so that following the word 'user' is your first and last name. Note: WordPad is a sufficient editor for editing our files.
5. Double click 'runps.bat' to start the simulator.
6. Avoid closing the DOS prompt as this will also close the simulator.

ii. Linux/Solaris

1. Execute the command 'unzip ps.zip -d ps' to unzip the simulator.
2. Navigate to the directory named 'ps' which contains the unzipped simulator.
3. Edit 'psconfig' so that following the word 'user' is your first and last name.
4. Now execute the shell script 'runps'. Note: You must have C Shell installed.
5. Avoid closing the terminal as this will also close the simulator.

III. Exercises

i. Introduction

1. The simulator operates by executing the same runs under one or more predefined algorithms. Those algorithms are FCFS, SJF, and RR #, where # is the quantum, which is defined as the number of units to execute for a process before it is removed from the processor.

2. First, execute the Process Scheduling Simulator and push the Run Experiment button. The default experiment should begin and display the current run being simulated in Event Log pane, which is located in the upper right of the simulator window.

3. The runs are located in a file named 'myexp.exp'. Notice that in the experiment file the runs are identified by the word 'run' with the following named run, keyword 'algorithm' preceding the respective predefined algorithm, and keyword 'key' preceding an identifier for that experiment.

4. Next, observe that all the runs are the same with the exception of differing algorithms. Returning to the simulator window we can view the statistics associated with each run by pushing Show All Table Data. In addition, we can view Gantt charts showing how each process in a run executed by pushing Draw Gantt Chart and selecting the run we wish to view or graphs demonstrating one statistic that pertains to all the runs by cycling through the statistics by pushing Graph Type then viewing that graph by pushing Draw.

5. The last feature of importance to us is the simulator's logging capability. Push Open Log to activate logging. Now, push Log All Table Data as this will log the same data that can be viewed when pushing Show All Table Data.

6. Next, draw a Gantt Chart for FCFS and in the new window push the button labeled Log in the lower right corner. Once finished, push Hide in the lower left corner of the window and this will return you to the simulator. Lastly, cycle thorough the graph types till you reach Turnaround, then push Draw. This will show the Turnaround Times for each run. Similar to logging the Gantt Chart, push Log and then Hide.
7. Finally, back at the simulator window push Show Local Log and verify that what you logged shows up in the log exactly in the order in which it was added. Now, close the simulator by pushing Quit in the lower right corner of the simulator window.

8. Notice a 'logfile.html' shows up in the working directory of the simulator. Open it to verify that this file is the same as the local log file that you viewed earlier. There will also be gif images in the same directory as the log file. These images contain the graph data that you logged. If the log file is ever moved you have to make sure to move these images as well so that the graph data shows in the new log location.

ii. Activity

1. Modify the 'myexp.exp' file to have 5 run lines that will use the following algorithms: FCFS, SJF, RR 1, RR 5, and RR 10. On each run line, make sure that both the algorithm and key are correctly identify each other.

2. Now modify the 'myrun.run' file so that there will be a total of 20 processes with the following properties:

• All processes arrive at time 0.0
• All processes have a constant duration of 100
• All have constant I/O bursts of 10
• All have basepriority 1.0
• The first set of 10 processes have CPU bursts uniformly distributed between 2 and 8
• The last set of 10 processes have CPU bursts uniformly distributed between 30 and 40
• Do not change the seed line of the run file as this will change the sample space.

3. Run the simulator and open a log file and add the tabular data and the 5 Gantt charts, one for each run.

4. Now let us analyze the results. SJF will have the best average waiting time. This is easily identifiable by graphing the Waiting. Why is this behavior evident with our chosen example?

5. Next, compare the trend in the Round Robin experiments as the quantum increases. For large values of the quantum which algorithm will Round Robin mimic and how large does the quantum need to be for our example?

6. Let us try to prove our conjecture by adding a 6th run to 'myexp.exp'. So to do this we must first Close Log and Quit our current session with the simulator. Now open the 'myexp.exp' and add an additional line defining a RR algorithm with your chosen quantum. Again, make sure the key correctly identifies the algorithm.

7. Run the simulator again and this time log the tabular data again but this time only log the 6th Gantt chart which should simulate the RR algorithm with a large quantum. So now, let us have the simulator Show Local Log which should correspond with our previous conjecture.

8. Finally, Close Log and Quit the simulator. Recall that the generated log can be viewed as an HTML file in the working directory of the simulator, and if the log file is moved so must the gif images be moved as well to the same destination directory.

IV. Assignments

1. (Activity 4)
2. (Activity 5)

V. Acknowledgments

The activities were adapted for Dr. William Stallings with permission from Dr. Steven Robbins. The original activities were written for the Operating Systems course taught at The University of Texas at San Antonio. These simulation exercises were developed by Adam Critchley (University of Texas at San Antonio).

Reference no: EM131842829

Questions Cloud

Capital punishment for the mentally ill : Topic: Is it morally permissible to use capital punishment for the mentally ill or handicapped who commit the worst crimes?
Is there really such a thing as morally right or morally wro : 1. Is there really such a thing as morally right or morally wrong? Explain.
Explain the causal theory of explanation : 1. Explain the causal theory of explanation and the dilemma that unobservable entities pose for this theory. Use examples.
Discuss the meaning or implications of the article contents : Discuss the meaning or implications of the article's contents, as well as any flaws you find in the article. What could have made the article better?
Compute the average waiting time and average response time : There are three processes in the scheduling queue. For each algorithm, compute the average waiting time, the average response time, and the throughput.
Understood functions of money : 1. One to two paragraphs. What are the three commonly understood functions of money? How successful is Bitcoin in fulfilling these functions? Is this a problem
Thinking about hume-kant-mill and everybody : At this point in the semester, you should have a pretty thorough grasp of virtue ethics, medieval and modern variations on natural law theory
Determining schedule performance index : When looking at the life of a project plan, it is useful to graph and outline the cost variance (CV), and schedule variance (SV).
Write a description of team leadership and its characteristc : Write a description of team leadership and its characteristics. Then, describe two challenges teams may face when leading an organization.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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