首页 > > 详细

C辅导 CSE 410 Fall2017解析C/C++ Assignment


Introduction
FCFS
Requirement
CSE 410 Fall2017
Computer Project #8
Assignment Overview
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 20 points (2 % of course grade) and must be completed no later than 11:59 PM on Thursday, 11/16.
Assignment Deliverables
The deliverables for this assignment are the following files:
proj08.makefile – the makefile which produces “proj08”
proj08.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 Readystate.
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
three lines of the file will contain the simulation parameters (one item per line):
a) Length of the simulation (in ticks)
b) Number of CPUs in the system (the integer value 1 for this assignment)
c) Short-term scheduling algorithm (the string “FCFS” for this assignment)
2. Exactly one line will follow the simulation parameters to represent the process stream. That line willcontain
the following fields, separated by blanks:
a) Process identification number
b) Priority (from 1 to 3)
c) Number of CPU bursts
d) Burst time (in ticks)
e) Blocked time (in ticks)
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 do zero or more of the following (in order):
a) Recognize a request issued by the process in the Running state
b) Recognize when theprocess in the Blocked state hasbecome unblocked
c) Recognize the arrival of a new process
d) Dispatch the process in the Ready state
4. When the process terminates, the program will display the following information about that process:
a) All process parameters (items (2a) to (2f) above)
b) Departure time (in ticks since start of simulation)
c) Cumulative time in the Ready state (in ticks)
d) Cumulative time in the Running state (in ticks)
e) Cumulative time in the Blocked state (in ticks)
f) Turnaround time (in ticks)
g) Normalized turnaround time
5. The program will accept two command-line arguments: an integer representing the value of N and the name of
the input file.
After every N ticks of simulated time, the program will display the following information:
a) Process ID of each process in the Ready state
b) Process ID of each process in the Running state
c) Process ID of each process in the Blocked state
The program will only display the information if N is a positive integer value.
6. The program will display the command-line arguments and the simulation parameters (items (1a) to (1c) above)
before processing the process stream.
7. The program will include appropriate error-handling.
Assignment Notes
1. In Project #9, you will extend your program from Project #8, so you would be wise to develop your program in a
modular fashion and to comment your source code.
2. For this assignment, you may assume that contents of the input file will be valid, and that there is exactly one
process in the process stream.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!