Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

MIDTERMS

Process management

Objectives:

This activity should allow the students to:


1. identify scheduling algorithms;
2. identify the scheduling criteria;
3. create programs using different data structures; and
4. use complex data types such as stack, queue, etc.

Problem(s) Related To The Topic:

Activity # 1.
1. Write an application program that performs non-preemptive
scheduling algorithm such as First Come First Serve (FCFS),
Shortest Job First (SJF) or non-preemptive Priority Scheduling
Algorithm (NPSA) . Draw the Gantt chart and calculate the CPU
utilization, systems throughput, average waiting time, and average
turnaround time.

Sample Output:

FCFS Algorithm
Process Burst Time
P1 24
P2 3
P3 3

Gantt chart

CPU utilization = 30/30 * 100% = 100%


Systems Throughput = 3/30 = 0.10
Waiting Time
P1 = 0
P2 = 24
P3 = 27
Average Waiting Time = 17
Turnaround Time
P1 = 24
P2 = 27
P3 = 30
Average Turnaround Time = 27
2. Write an application program that performs preemptive scheduling
algorithm such as Shortest Remaining Time First (SRTF), Round
Robin(RR), or preemptive Priority Scheduling Algorithm (PPSA) .
Draw the Gantt chart and calculate the CPU utilization, systems
throughput, average waiting time, and average turnaround time.

Sample Output:

SRTF Algorithm

CPU utilization = 16/16 * 100% = 100%


Systems Throughput = 4/16 = 0.25
Waiting Time
P1 = 9
P2 = 1
P3 = 0
P4 = 2
Average Waiting Time = 12/4 = 3
Turnaround Time
P1 = 16
P2 = 5
P3 = 1
P4 = 6
Average Turnaround Time = 28/4 = 7

You might also like