c++代写 CSE 410 Assignment

CSE 410
Assignment Overview

Fall 2018

Computer Project #9

This assignment focuses on process management within an operating system, including processor scheduling. You will design and implement the C/C++ program which is described below.

It is worth 40 points (4% of course grade) and must be completed no later than 11:59 PM on Thursday, 11/29.

Assignment Deliverables

The deliverables for this assignment are the following files: proj09.makefile – the makefile which produces proj09

proj09.student.c – the source code file for your solution
Be sure to use the specified file names and to submit your files for grading via the CSE handin system before the

project deadline.

Assignment Specifications

The program will simulate the steps that an operating system takes to manage user processes. The operating system uses a five-state process model: New, Ready, Running, Blocked, and Exit.

When a process is created, it is assigned a Process Control Block (PCB) and it moves into the Ready state.

While in the Running state, a process may issue two types of requests: a request to halt (which is issued when a process has completed its processing and is ready to leave the system), and a request to block (which is issued when the process must wait for some event, such as an I/O operation).

When a process becomes unblocked, it moves from the Blocked state to the Ready state.

1. Your program will process a file which contains the simulation parameters and the process stream. The first two lines of the file will contain the simulation parameters (one item per line):

  1. a)  Length of the simulation in ticks (an integer; 0 or more for this assignment)
  2. b)  Short-term scheduling algorithm (a string; “FCFS” for this assignment)

2. Zero or more lines will follow the simulation parameters to represent the process stream. Each line will contain the following fields, separated by blanks:

  1. a)  Process identification number
  2. b)  Priority (from 1 to 3)
  3. c)  Number of CPU bursts
  4. d)  Burst time (in ticks)
  5. e)  Blocked time (in ticks)
  6. f)  Arrival time (in ticks since start of simulation)

The number of CPU bursts is an integer value representing the number of times that the process uses the CPU.

The burst time is an integer value representing the length of time that the process uses the CPU before issuing a service request.

The blocked time is an integer value representing the length of time that the process is blocked after issuing a service request.

3. On each tick of simulated time, the program will display the following information:

  1. a)  The current tick
  2. b)  All state transitions which occur (see below)
  3. c)  Process identification number of each process in the Ready state
  4. d)  Process identification number of each process in the Running state
  5. e)  Process identification number of each process in the Blocked state

That display will reflect the state of the system immediately before the transition from one tick to the next (after all actions associated with the current tick have occurred, but before any actions associated with the next tick).

4. On each tick of simulated time, the program will handle zero or more of the following transitions (in order):

  1. a)  Recognize a request issued by a process in the Running state
  2. b)  Recognize when a process in the Blocked state has become unblocked
  3. c)  Recognize the arrival of a new process
  4. d)  Dispatch a process in the Ready state

Whenever the program moves a process from one state to another, it will display the process identification number and the two states. For example: PID 23: Running to Blocked

5. When a process terminates, the program will display the following information about that process:

a) b) c) d) e) f) g)

9. The program will include appropriate error-handling.

Assignment Notes

1. For this assignment, you may assume that the contents of the input file will be valid.

2. In Project #10, you will extend your program from Project #9, so you would be wise to properly structure and comment your source code.

All process parameters (items (2a) to (2f) above) Departure time (in ticks since start of simulation) Cumulative time in the Ready state (in ticks) Cumulative time in the Running state (in ticks) Cumulative time in the Blocked state (in ticks) Turnaround time (in ticks)

Normalized turnaround time (with two fractional digits of accuracy)

program will accept one command-line argument: the name of the input file.

string “FCFS” represents non-preemptive first-come-first-served scheduling.

program will use “less than” on process identification numbers to break any ties. For example, if process 4 and process 5 both arrive at tick 0, process 4 will be placed in the Ready state before process 5.

6. The 7. The 8. The