Professional Documents
Culture Documents
Experiment 1 Process Scheduling: Source Code
Experiment 1 Process Scheduling: Source Code
10
--------------------------------------------------------------------------------------------------------
NAME:Vishak Nair GRADE:
SE-Comps-B3
RN:70 SIGN:
--------------------------------------------------------------------------------------------------------
EXPERIMENT 1
PROCESS SCHEDULING
Source Code:
program LoopTest
i=0
for n = 0 to 40 i = i + 1
next
end
BINARY CODE
LOAD IN MEMORY
OS simulator.
Create processes
scheduling policies
1) FCFS
View process list:
Process list:
PCB
View process state:
START process
Running Process:
Waiting time:
B)SJF
Waiting time:
C) Round Robin
Waiting time:
EXPERIMENT 2
Investigating Threads
OS Simulator:
EXPERIMENT 3
Deadlock
Instance1:
program DeadlockP1
resource(0, allocate)
wait(3)
resource( 1, allocate) //WAITING FOR RESOURCE1
for n = 1 to 20
next
End
Instance2:
program DeadlockP2
resource(1, allocate)
wait(3)
resource( 2, allocate)
for n = 1 to 20
next
End
Instance3:
program DeadlockP3
resource(2, allocate)
wait(3)
resource( 3, allocate)
for n = 1 to 20
next
End
Instance4:
program DeadlockP4
resource(3, allocate)
wait(3)
resource( 0, allocate)
for n = 1 to 20
next
End
R0 allocated to Process1
R1 allocated to Process2
R2 allocated to Process3
R3 allocated to Process4