JOB SCHEDULING IN NON-MULTIPROGRAMMING ENVIRONMENT
Average turn around time computation
T=n=0nTix 1n
Where:
Ti= Fi- Ai * Fi= Finish Time * Ai= Arrival Time * n = no. of jobs
Fi= ST+ RT * ST= Start Time * RT= Run Time
WTAT= TATACTUAL RUNTIME * WTAT= Weighted turn around time * TAT= Fi- Ai
EXAMPLE # 1: FIFO
JOB | ARRIVAL TIME | RUN TIME | 1 | 10.00 | 2.00 | 2 | 10.10 | 1.00 | 3 | 10.25 | 0.25 |
ANSWER:
JOB NO. | ARRIVAL TIME | START TIME | FINISH TIME | TAT | WTAT | 1 | 10 | 10.00 | 12.00 | 2.00 | 1.00 | 2 | 10.10 | 12.00 | 13.00 | 2.90 | 2.90 | 3 | 10.25 | 13.00 | 13.25 | 12.00 | 12.00 |
TATaverage=2.6
WTATaverage=5.30
FIFO MULTIPROGRAMMING W/ NO I/O OVERLAP * HEADWAY = Amount of CPU spent on a job * HEADWAY/JOB = (%CPU/JOB)(ELAPSED TIME) * %CPU/JOB = 1n = Reciprocal of the no. of job * ELAPSED TIME = Time of Consideration = Current time – Previous Time
JOB | ARRIVAL TIME | RUN TIME | 1 | 10.00 | 0.3 | 2 | 10.20 | 0.5 | 3 | 10.40 | 0.1 | 4 | 10.50 | 0.4 | 5 | 10.80 | 0.1 |
EXAMPLE # 2:
TIME | EVENT | # OF JOBS | %CPU/JOB | ELAPSED TIME | HEADWAY/JOB | JOB | TIME LEFT | 10.00 | J1A | 0 | 0 | 0 | 0 | 1 | 0.3 | 10.20 | J2A | 1 | 1 | 0.20 | 0.20 | 2 | 0.5 | | | | | | | 1 | 0.1 | 10.40 | JIT | 2 | 0.5 | 0.2 | 0.10 | 2 | 0.4 | | J3A | | | | | 1 | 0 | | | | | | | 3 | 0.1 | 10.50 | J4A | 2 | 0.5 | 0.1 | 0.05 | 4 | 0.4 | | | | | | | 3 | 0.05 | | | | | | | 2 | 0.35 | 10.65 | J3T | 3 | 0.33 | 0.15 | 0.05 | 4 | 0.35 | | | | | | | 3 | 0 | | | | | | | 2 | 0.3 | 10.80 | J5A | 2 | 0.50 | 0.15 | 0.075 | 5 | 0.1 | | | | | | | 4 | 0.275 | | | | | | | 2 | 0.225 | 11.10 | J5T | 3 | 0.333 | 0.30 | 0.10 | 5 | 0 | | | | | | | 4 | 0.175 | | | | | | | 2 | 0.125 | 11.35 | J2T | 2 | 0.5 | 0.25 |