Docsity

Programming Assignment 1: Uniprocessor Scheduling Protocols | COP 4600, Assignments of Operating Systems

Toggle sidebar
bg1
Title: “Program Assignment 1: Uniprocessor Scheduling Protocols”
Points: 100 points
Due Date: Sunday July 12th by 11:55 pm (WebCourses time)
Objectives: To develop a simulation program for various uniprocessor scheduling protocols.
Description: Develop a program using C, C++, or Java that simulates various uniprocessor
scheduling protocols and produces a Gantt chart of their execution profiles as well as producing the
average waiting time, average turnaround time, and the normalized turnaround time for each
process in the schedule of ready processes. The technique for producing the results is the same that
you utilized in problem #3 in the first homework assignment. Implement the following scheduling
protocols: FCFS (First Come – First Served), RR (Round-Robin) with time quantums of 1 and 3,
and SPN (Shortest Process Next). Assume that the input to the program is in the form of a file
(named “schedule.dat”) containing only integer values with the following format:
line 1: COUNT, indicating the number of processes in the ready queue.
line 2: TIME, indicating the total processing time required by all processes
in the ready queue.
x lines: PROCESS_ID ARRIVAL_TIME PROCESSING_TIME (where x = COUNT)
Using the set of processes from homework #1, problem #3 as an example, the input file representing
these processes would look like the following (available on the course website):
For a given input file, your program should produce, as output, the Gantt chart and statistics
mentioned above for each of the four protocols. An example of a possible output form is shown
below, I used 3 different symbols for the possible process states: W = waiting, E = executing (i.e.,
process holds the CPU), T = terminated (process has completed). An empty cell in the matrix
simply means that the process has not yet entered the ready queue.
Page 1
COP 4600 – Programming Assignment #1 – Summer 2009
pf3

Partial preview of the text

Download Programming Assignment 1: Uniprocessor Scheduling Protocols | COP 4600 and more Assignments Operating Systems in PDF only on Docsity!

Title: “Program Assignment 1: Uniprocessor Scheduling Protocols”

Points: 100 points

Due Date: Sunday July 12th^ by 11:55 pm (WebCourses time)

Objectives: To develop a simulation program for various uniprocessor scheduling protocols.

Description: Develop a program using C, C++, or Java that simulates various uniprocessor

scheduling protocols and produces a Gantt chart of their execution profiles as well as producing the

average waiting time, average turnaround time, and the normalized turnaround time for each

process in the schedule of ready processes. The technique for producing the results is the same that

you utilized in problem #3 in the first homework assignment. Implement the following scheduling

protocols: FCFS (First Come – First Served), RR (Round-Robin) with time quantums of 1 and 3,

and SPN (Shortest Process Next). Assume that the input to the program is in the form of a file

(named “schedule.dat”) containing only integer values with the following format:

line 1: COUNT, indicating the number of processes in the ready queue.

line 2: TIME, indicating the total processing time required by all processes

in the ready queue.

x lines: PROCESS_ID ARRIVAL_TIME PROCESSING_TIME (where x = COUNT)

Using the set of processes from homework #1, problem #3 as an example, the input file representing

these processes would look like the following (available on the course website):

For a given input file, your program should produce, as output, the Gantt chart and statistics

mentioned above for each of the four protocols. An example of a possible output form is shown

below, I used 3 different symbols for the possible process states: W = waiting, E = executing (i.e.,

process holds the CPU), T = terminated (process has completed). An empty cell in the matrix

simply means that the process has not yet entered the ready queue.

COP 4600 – Programming Assignment #1 – Summer 2009

FCFS

1 E E E T T T T T T T T T T T T T T T T T

2 W W E E E E E T T T T T T T T T T T T

3 W W W W W E E T T T T T T T T T T

4 W E E E E E T T T T T

5 W W W E E E E E

normalized wait turnaround turnaround 1 0 3 1 2 2 7 1. 3 5 7 3. 4 1 6 1. 5 3 8 1. AVG 2.2 6.2 1.

References:

Notes: Lecture Notes for Uniprocessor Scheduling.

Restrictions:

Your source file shall begin with comments containing the following information:

/* Name:

Course: COP 4600 Summer 2009

Assignment title: Program #1 – Uniprocessor Scheduling Simulation

Date: July 12, 2009

Input Specification: The file “schedule.dat” as described above (see example below as well).

Output Specification: Output should be four different Gantt charts and sets of statistics

corresponding to the four scheduling protocols (FCFS, RR with quantum

= 1, RR with quantum = 3, and SPN).

Deliverables:

(1) Submit a working copy of your source code via WebCourses no later than 11:55pm Sunday

July 12th.

Additional Information:

Shown below is another sample input file – this one represents the ready queue from problem

on the first exam.