OS-Lab Manual
OS-Lab Manual
Operat
ing
Syste
m and
Applic
ations
Labora
Prepared by:
tory
Bermelita T. Domingo
Faculty
Manua
l
Table of Contents
No. List of Experiments Page No.
1 Process Scheduling: FCFS Simulation
2 Process Scheduling: SJF Simulation
3 Process Scheduling: Priority Simulation
4 Process Scheduling: Round-Robin Simulation
5 Process Synchronization Simulation
6 Deadlock Avoidance: Banker’s Algorithm
Simulation
Exercise No.: 1
Title of Exercise: Process Scheduling: First-come First-serve (FCFS)
Simulation
Objective: Using FCFS algorithm, find the average waiting time during
process execution.
Software Requirements: Eclipse/ Visual Studio.Net
Theory
CPU can only run a single process at a time. Multiple processes all
queued and wanting CPU time
Scheduling answers the question: Which process to run at a given point
in time?
Processes undergo a CPU – I/O burst cycle
Processes are executed in the order that they arrive in the ready
queue.
Procedure
Example:
Process Burst Time
P1 24
P2 3
P3 3
Suppose that the processes arrive in the order: P1, P2, P3
The Gantt chart for the schedule is:
QUESTIONS:
1. What is First-Come-First-Served (FCFS) Scheduling?
2. Why CPU scheduling is required?
3. CPU performance is measured through ________.
a) Throughput b) MHz c) Flaps d) None of the above
4. Which of the following is a criterion to evaluate a scheduling
algorithm?
A. CPU Utilization: Keep CPU utilization as high as possible.
B. Throughput: number of processes completed per unit time.
C. Waiting Time: Amount of time spent ready to run but not running.
D. All of the above
Exercise No.: 2
Title of Exercise: Process Scheduling: Shortest-Job-First (SJF)
Simulation
Objective: Using SJF algorithm, find the average waiting time during
process execution.
Software Requirements: Eclipse/ Visual Studio.Net
Theory
Exercise No.: 3
Title of Exercise: Process Scheduling: Priority Simulation
Objective: Using Priority algorithm, find the average waiting time
during process execution.
Software Requirements: Eclipse/ Visual Studio.Net
Theory
Exercise No.: 4
Title of Exercise: Process Scheduling: Round-Robin Simulation
Objective: Using Round-Robin algorithm, perform a simulation of
process execution.
Software Requirements: Eclipse/ Visual Studio.Net
Theory