UE CS 470 - Process Management Project

Unformatted text preview:

CS 470 - Operating SystemsSpring 2007 – Process Management Project40 pointsOut: February 2, 2007Due: February 16, 2007The purpose of this project is to gain an appreciation of the work involved in managing processes. The assignment is to write a simple process manager simulation. Problem StatementThe program should simulate the process state structure shown in Figure 3.2 on page 83 of the textbook. Input to drive the simulation should be read in from a file, and output should be written to a file. The format of the input file will be discussed below. In the simulation, each process is identified by a Process ID (PID). For our purposes, the process control block (PCB) of each process will keep track of at least the parent of each process, all of the children of each process, and the remaining burst time for the process (i.e., what is left of the total amount of time requested), and the remaining quantum time for the current process' quantum. All processes are preemptible. When an interrupt occurs, the running process is "preempted," and its remaining burst time and remaining quantum time is decremented by 1. When the remaining burst time of a process reaches 0, it terminates. Whenever a process terminates, all its children also must be terminated. I.e., this simulation has cascading termination semantics. After an interrupt, if the current process is not continuing, the first process on the Ready Queue becomes the running process with a new time quantum. If there are no processes on the Ready Queue, assume that a pseudo-process with PID 0 runs, but this "process" is never put on the Ready queue. (Thus when the simulation first begins, the only thing in the system is the pseudo-process 0, and it is the parent of the first "real" process.) Input consists of a series of actions each of which is initiated by an interrupt. Any requests come from the current running process. The actions are: C n b Create a process with PID n with initial burst size b and add it to the Ready Queue. The parent is the current process. D n Destroy the process with PID n and any children processes that it has. Only the parent of process n or process n itself can destroy process n. Other requests are ignored. You may assume that there will not be any requests to destroy PID 0. I Timer interrupt. 02/1/2007 1W n Current process has initiated an event with Event ID (EID) n that it must wait for and moves to the Wait Queue. E n Event with EID n has taken place. The process waiting for this event moves to the Ready Queue. Note this action may also preempt the current process. X Exit the program. The program should output the current state of the simulation before exiting. For the purposes of this simulation, each interrupt counts as a timer interrupt in time. For example, when a process creates a child process, the parent's remaining burst time is decremented by 1 (as is its remaining quantum time). For actions, D, I and W, if there is no currently running process, the action is ignored. For action E, if there is no process waiting for the EID event, then the action is ignored. Output should consist of a log of actions performed (i.e., the input and any state transitions that processes make) and any other information you deem interesting (e.g., the state of the Ready Queue, etc.). For example, if we are using RR (q=3) scheduling, you might have as the input file the lines in italics and output the following log (where "PID n b" means process n with burst time b remaining, and "with q left" means q time left in the current quantum): PID 0 runningI C 5 5C 1 7PID 1 2 running with 1 left PID 5 5 placed on Ready QueuePID 1 7 placed on Ready QueueE 4PID 5 5 running with 3 leftPID 1 7 running with 3 left PID 1 1 placed on Ready QueueC 6 3IPID 2 2 placed on Ready Queue PID 6 3 placed on Ready QueuePID 1 6 running with 2 left PID 3 10 running with 3 left PID 5 4 running with 2 leftC 2 3 I W 7PID 2 3 placed on Ready Queue PID 3 9 running with 2 left PID 5 3 placed on Wait QueuePID 1 5 running with 1 leftIPID 6 3 running with 3 leftIPID 3 8 running with 1 leftXPID 1 4 placed on Ready QueueIPID 2 3 running with 3 left PID 3 7 placed on Ready Queue Current state of simulation:W 4PID 1 1 running with 3 left PID 6 3 running with 3 leftPID 2 2 placed on Wait QueueIReady Queue: emptyPID 1 4 running with 3 left PID 1 0 terminated Wait Queue: PID 5 3 for EID 7C 3 10PID 2 2 terminatedPID 3 10 placed on Ready Queue PID 3 7 terminatedPID 1 3 running with 2 left PID 0 running02/1/2007 2Assignment(20 points) This project may be done in individually or in pairs (group of 2). Each student/pair must implement a simulation meeting the specifications above for the RR scheduling algorithm for a quantum size that can be set for each run of the program.The simulator may be written in any language. However, the instructor can provide assistance only for C/C++ projects. The file names and quantum size value may be provided to the simulation either as command-line arguments or interactively. (10 points) Each student/pair must provide a high-level functional analysis and design of the program describing the functionality of the major components of the program and how they interact with each other, and a more detailed analysis and design for the data structures and algorithms used in implementing the Ready and Wait Queues. (10 points) Students must provide printouts of the results of their simulation using the test files provided on csserver in ~hwang/cs470/project2 (to be released on or before February 9) for q= 1, 5, and 10. In addition, each student/pair should answer the following questions: 1. Compare the test files and their resulting output. What can be said about the RR scheduling algorithm? What can you say about the effect of different quantum sizes? 2. What aspect of process management did you find most difficult to implement? 3. What aspect of process management did you find easiest to implement? 4. What, if anything, would you change in your current design? 5. What, if anything, did you find interesting or surprising about process management that you did not know before doing this project? What to SubmitSubmit items no later than 4:30pm on the due date.Create a tarfile containing the source code and makefile for the project. Submit this tarfile electronically by emailing it as an attachment to the instructor. Submit the following items in hardcopy:● A printout of well-documented code for your


View Full Document

UE CS 470 - Process Management Project

Download Process Management Project
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Process Management Project and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Process Management Project 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?