Example of Input/Output for Assignment #3, CS-405
Input: 100
10
one 30
two 50
thr 20
for 40
Output:
The amount of resource available is 100 units
The degree of multiprogramming is 10
FCFS:
Event Time
Job one is Running 0
Job one Done 30
Job two is Running 30
Job two Done 80
Job thr is Running 80
Job thr Done 100
Job for is Running 100
Job for Done 140
All Jobs Done 140
Input: 100
10
one 30 20 30 10 30
two 50 10 50 30 50
thr 20 60 20 20 20
for 40 30 40 10 40
Output:
The amount of resource available is 100 units
The degree of multiprogramming is 10
Job one needs a max of 30
Job two needs a max of 40
Job thr needs a max of 80
Job for needs a max of 40
FCFS:
Event Time
System (100) 0
Job one is Running 0
Job one needs resource 30
Allocated (20): Remaining (10): System (80) 30
Job two is Running 30
Job two needs resource 80
Allocated (10): Remaining (30): System (70) 80
Job thr is Running 80
Job thr needs resources 100
Allocated (60): Remaining (20): System (10) 100
Job for is Running 100
Job for needs resource 140
Denied: Not enough available: Wait 140
Job one Running 140
Job one needs resource 170
Allocated (10): Remaining (0): System (0) 170
Job two is Running 170
Job two needs resource 170
Not enough available: Wait 220
Job thr is Running 220
Job thr needs resource 240
Denied: Not enough available: Wait 240
Job one is Running 240
Job one Done 270
System (30) 270
Request by Job for Denied: UNSAFE: Wait 270
Request by Job two Allocated (40): Remaining (0): System (0) 270
Request by Job thr Denied: Not enough available: Wait 270
Job two is Running 270
Job two Done 320
System (40) 320
Request by job for Allocated (30): Remaining (10): System (10) 320
Request by Job thr Denied: Not enough available: Wait 320
Job for is Running 320
Job for needs resource 360
Allocated (40): Remaining (0): System (0) 360
Job for is Running 360
Job for Done 400
System (40) 400
Request by Job thr Allocated (80): Remaining (0): System (20) 400
Job thr is Running 400
Job thr Done 420
System (100) 420
All Jobs Done 420
NUMBER OF JOBS IN THE
SYSTEM SHOULD NOT BE MORE THAN THE DEGREE OF MULTIPROGRAMMING.
AS JOBS GET DONE – IT
SHOULD ALSO TRIGGER WAITING JOBS TO ENTER THE SYSTEM (IN ADDITION TO RETURNING
RESOURCES TO THE SYSTEM AND TRIGGERING REQUEST PROCESSING).