In this project you will simulate the operating system's selection of processes to send to the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In this project you will simulate the operating system's selection of processes to send to the CPU. The operating system will select the next process from the of awaiting processes. Each process will require 1 or more the resources A, B and C. Some processes will require only B for example, while another might require A and B, yet another B and C. If the resource is available, the process can be started. If one or more of the resources are unavailable then the process must wait one cycle. A process that is started will only a resource for one cycle. Here is a chart describing a possible scenario:< P1(A); P2(B); P3(B,C); P4(C);P5(A,B,C); Starting process list with resources in (): P6(B,C) ;P7(A);P8(A);P9(B);P10(C)< Cycle 14 24 3 4 Processes Running P1, P2 4 54 Comment P3 must wait - Resource B in use Notice P4 can not start ahead of P3 though its resource is available 2 P3¹ P4 P5 P6 P7 6 P8,P9,P10 There are 2 parts to the assignment, both parts have the same output of the number of cycles, and final length of the queue.< Part A Read a file where each record has the format shown here (and above): < P1(A);P2(B); P3(B,C);P4(C);P5(A,B,C); P6(B,C) ;P7(A);P8(A);P9(B);P10(C) < For each record assign the processes to a list, then execute the list and determine the number of cycles to completely execute the processes. In our example the answer is 6 2 J 2 ( E E J J E E 2 ← Part B: Randomly generate a list of 20 processes. Start executing processes as before. But at the end of each cycle (regardless of how many processes were run), add 2 more processes to the end of the list. Output the number of cycles needed to empty the list of processes, but if the list does not empty by cycle 1000, then output the number of processes left (length of the list). Output the length of the list of processes every 100th cycle to watch its growth:< Length of processes at cycle 100: 104 Length of processes at cycle 200: 107< Length of processes at cycle 300: 63 Length of processes at cycle 400: 139 Number are samples only, your numbers should be different.< The goal of the exercise to understand how to simulate the operating system's selection of processes to run.< Objectives The goal of this programming project is for you to master (or at least get practice on) the following tasks:< Read input files< Work with singly linked list • Utilize random numbers ( ● ● Start early! This project may not seem like much coding, but debugging always takes time. Analyze and plan now so questions are not being asked a day before the due date.< ← Working on This Assignment You should start right away! First be sure you can replicate the results provided here. Then create some of you own test files. Next run the other provided input files. Finally due to random generation part of the project - do some tracing to show interim results.< Grading Criteria - 20 points 1. (3) Input files are read properly 2. (5) Linked list accurately represents the processes and is correctly processed in the program 3. (5) Part A runs properly and has the correct result outputted from the provided list 4. (7) Part B runs properly and has the correct result of the simulation In this project you will simulate the operating system's selection of processes to send to the CPU. The operating system will select the next process from the of awaiting processes. Each process will require 1 or more the resources A, B and C. Some processes will require only B for example, while another might require A and B, yet another B and C. If the resource is available, the process can be started. If one or more of the resources are unavailable then the process must wait one cycle. A process that is started will only a resource for one cycle. Here is a chart describing a possible scenario:< P1(A); P2(B); P3(B,C); P4(C);P5(A,B,C); Starting process list with resources in (): P6(B,C) ;P7(A);P8(A);P9(B);P10(C)< Cycle 14 24 3 4 Processes Running P1, P2 4 54 Comment P3 must wait - Resource B in use Notice P4 can not start ahead of P3 though its resource is available 2 P3¹ P4 P5 P6 P7 6 P8,P9,P10 There are 2 parts to the assignment, both parts have the same output of the number of cycles, and final length of the queue.< Part A Read a file where each record has the format shown here (and above): < P1(A);P2(B); P3(B,C);P4(C);P5(A,B,C); P6(B,C) ;P7(A);P8(A);P9(B);P10(C) < For each record assign the processes to a list, then execute the list and determine the number of cycles to completely execute the processes. In our example the answer is 6 2 J 2 ( E E J J E E 2 ← Part B: Randomly generate a list of 20 processes. Start executing processes as before. But at the end of each cycle (regardless of how many processes were run), add 2 more processes to the end of the list. Output the number of cycles needed to empty the list of processes, but if the list does not empty by cycle 1000, then output the number of processes left (length of the list). Output the length of the list of processes every 100th cycle to watch its growth:< Length of processes at cycle 100: 104 Length of processes at cycle 200: 107< Length of processes at cycle 300: 63 Length of processes at cycle 400: 139 Number are samples only, your numbers should be different.< The goal of the exercise to understand how to simulate the operating system's selection of processes to run.< Objectives The goal of this programming project is for you to master (or at least get practice on) the following tasks:< Read input files< Work with singly linked list • Utilize random numbers ( ● ● Start early! This project may not seem like much coding, but debugging always takes time. Analyze and plan now so questions are not being asked a day before the due date.< ← Working on This Assignment You should start right away! First be sure you can replicate the results provided here. Then create some of you own test files. Next run the other provided input files. Finally due to random generation part of the project - do some tracing to show interim results.< Grading Criteria - 20 points 1. (3) Input files are read properly 2. (5) Linked list accurately represents the processes and is correctly processed in the program 3. (5) Part A runs properly and has the correct result outputted from the provided list 4. (7) Part B runs properly and has the correct result of the simulation
Expert Answer:
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
The figure below is a schematic illustration of a building elevator shaft/elevator. Assume that the elevator ascends with a constant velocity V = Velev. The elevator weight when full is W. Assume the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
Ultimate Consulting is a management consulting firm that offers a wide range of services to companies in many industries. To stay on the cutting edge of developments in the business world and to...
-
If the horizontal towing force is T = 20 kN and the chain has a mass per unit length of 15kg/m, determine the maximum sag h. Neglect the buoyancy effect of the water on the chain. The boats...
-
Given independent random variables with means and standard deviations as shown, find the mean and standard deviation of: a) 3X b) Y + 6 c) X + Y d) X - Y e) X1 + X2 Mean SD X 10 2 Y 20 5
-
Draw a task graph in which P1 and P2 each process separate inputs and then pass their results onto P3 for further processing.
-
Jakes Roof Repair has provided the following data concerning its costs: Cost per Fixed Cost Repair-Hour Per Month $16.30 Wages and salaries $23,200 Parts and supplies . $8.60 Equipment depreciation...
-
A taxpayer receives unemployment income for the year from their home state. What form should they be expecting to show that they received this income?
-
The Scottsville Textile Mill1 produces five different fabrics. Each fabric can be woven on one or more of the mills 38 looms. The sales departments forecast of demand for the next month is shown in...
-
The following data is used in a cut and try aggregate planning under the 'Exact production: Vary workforce model: Demand Forecast Number of working days Inventory holding cost = $10/unit Hiring and...
-
Often times, it is necessary to remove certain entries from a data set, list, etc., then create a new file or list with those results. a. Use a file created by your Lab 4 data file creator, which has...
-
Galaxy Corp. has to choose between two mutually exclusive projects. If it chooses project A, Galaxy Corp. will have the opportunity to make a similar Investment in three years. However, if it chooses...
-
A farmer has 34 less roosters than hens. If he has a total of 130 chickens altogether, how many roosters does he have?
-
An economy has two firms. Firm A produces wheat and firm B produces bread. In a given year, produces 50 bushels of wheat, sells 20 bushels to firm B at $3, exports 25 bushels at the same price to...
-
Is this exception to standard VFR weather minimums a good idea that helps facilitate the movement of air traffic? Do you personally think that SVFR is a safe practice that you would consider using?...
-
JD is a 25 year old patient who sustained massive head trauma and neurological injury in a motorcycle accident. He is not brain dead, but after 4 weeks in MICU and several neuro consults, the...
-
we have to compute the letter grades for a course. The data is a collection of student records stored in a file. Each record consists of a name(up to 20 characters), ID (8 characters), the scores of...
-
What is a package in UML approach?
-
The five-year-old TowerWood hotel chain needs help designing its Web site. The company maintains properties in all the large U.S. tourist communities such as Orlando, Florida (near Disney World);...
-
Define what is meant by the agile approach.
-
How can speakers use anxiety to their advantage?
-
What are common psychological, physical, and behavioral reactions associated with speech anxiety?
-
Describe strategies for making people the focus of your presentations.
Study smarter with the SolutionInn App