
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