Programming Project 2 on Computer and Information Sciences | CISC 361, Study Guides, Projects, Research of Operating Systems

Material Type: Project; Class: Operating Systems; Subject: Computer/Information Sciences; University: University of Delaware; Term: Fall 2005;

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 09/02/2009

koofers-user-r4z
koofers-user-r4z 🇺🇸

9 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Course: CISC 361
Operating Systems
Computers and Information Sciences
Semester: Fall 2005
Programming Project 2
Due Date: Tues. Nov 15
1 Written Assignment
Consider the following list of jobs arriving on a preemptive round-robin scheduled system with a quantum
of 5: (All times are in clock ticks, you may assume no context switch overhead for this analysis)
Process ID Expected Running Arrival Time Completion Turnaround
Time Time Time
P1 25 0
P2 40 11
P3 10 15
Fill in the above table.
What is the systems average turn around time for these processes.
pf3

Partial preview of the text

Download Programming Project 2 on Computer and Information Sciences | CISC 361 and more Study Guides, Projects, Research Operating Systems in PDF only on Docsity!

Course: CISC 361

Operating Systems

Computers and Information Sciences

Semester: Fall 2005

Programming Project 2

Due Date: Tues. Nov 15

1 Written Assignment

Consider the following list of jobs arriving on a preemptive round-robin scheduled system with a quantum of 5: (All times are in clock ticks, you may assume no context switch overhead for this analysis)

Process ID Expected Running Arrival Time Completion Turnaround Time Time Time P1 25 0 P2 40 11 P3 10 15

  • Fill in the above table.
  • What is the systems average turn around time for these processes.

2 Programming Assignment-Simulator, Part 1

In this assignment you will build a simualator that runs processes and three different scheduling algorithms. To run this program the data is input from a file (on the web page) named joblist.data. One entry in the joblist consists of two fields:

  • Job arrival (or start) time
  • Total CPU time need for this job

There are 5000 entries in the file and the file is sorted according to start time. All of the fields are integers. Your goal is to schedule these 5000 jobs using THREE different scheduling algorithms. You may use three from class, or invent a new one(s). Since you know in advance the total time a process may run, use that fact to your advantage.

To implement this programming assignment, you will use a library which implements a simple cpu. The library contains the following public functions:

  • void initCPU(int CSCost,int verbose)
    • Set up the cpu (boot) setting the cost of a context switch. The verbose parameter, when non zero, causes lots of debugging information to be displayed when the CPU runs.
  • void closeCPU()
    • Clean up CPU (shutdown) and print basic CPU statistics
  • int getCurrentJob()
    • returns the pid of the job currently on the CPU or zero (0) if no such job exists.
  • int contextSwitch(int newPID,int timeToRun)
    • Initiate a context switch. Pass the pid and “total” run time of the process that should get the CPU and returns the PID of the process relinquishing the CPU or zero (0) if no such process exists.
    • Notes:
      • If 0 is passed as new PID an error occurs.
      • If the new PID equals the pid of the currently running process, everything works, but no cost is assessed for the context switch.
      • If no process is on the CPU, no cost is assessed.
      • Otherwise, the CSCost from initCPU is assessed and the clock incremented.
  • int tickCPU()
    • Execute a single clock tick. Returns 1 if a process completed. Returns -1 if the CPU is idle, and return 0 otherwise.
  • int getClock()
    • Returns the current value of the zero based CPU clock.