Job Scheduling

Only available on StudyMode
  • Download(s) : 113
  • Published : March 10, 2013
Open Document
Text Preview
i
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| 0.125| 4| 0.05|
| | | | | | 2| 0|
11.40| J4T| 1| 1| 0.05| 0.05| 4| 0|
FIFO MUTIPROGRAMMING W/ I/O OVERLAP

* HEADWAY/JOB = (%CPU/JOB)(ELAPSED TIME)

* %CPU/JOB = 1-CPU WAIT# OF JOBS

NOTE: CPU Utilization is 75% of Runtime

EXAMPLE # 3
JOB| ARRIVAL TIME| RUN TIME|
1| 10| 0.3|
2| 10.2| 0.5|
3| 10.4| 0.1|
4| 10.5| 0.4|
5| 10.8| 0.1|
# OF JOBS| CPU WAIT|
0| 0|
1| 0.25|
2| 0.04|
3| 0|
TIME| EVENT| # OF JOBS| CPU WAIT| %CPU/JOB| ELAPSED TIME| HEADWAY/JOB| JOB| CPU TIME NEEDED| 10.000| J1A| 0| 0| 0| 0| 0| 1| 0.225|
10.200| J2A| 1| 0.25| 0.75| 0.2| 0.15| 2| 0.375|
| | | | | | | 1| 0.075|
10.356| J1T| 2| 0.04| 0.48| 0.156| 0.075| 1| 0|
| | | | | | | 2| 0.3|
10.400| J3A| 1| 0.25| 0.75| 0.044| 0.033| 3| 0.075| | | | | | | | 2| 0.267|
10.500| J4A| 2| 0.04| 0.48| 0.1| 0.048| 4| 0.3|
| | | | | | | 3| 0.027|
| | | | | | | 2| 0.219|
10.581| J3T| 3| 0| 0.333| 0.081| 0.027| 4| 0.273|
| | | | | | | 3| 0|
| | | | | | | 2| 0.192|
10.800| J5A| 2| 0.04| 0.48| 0.219| 0.105| 5| 0.075| | | | | | | | 4| 0.168|
| | | | | | | 2| 0.087|
11.025| J5T| 3| 0| 0.333| 0.225| 0.075| 5| 0|
| | | | | | | 4| 0.093|
| | | | | | | 2| 0.012|
11.05| J3T| 2| 0.04| 0.48| 0.025| 0.012| 2| 0|
| | | | | | | 4| 0.081|
11.158| J4T| 1| 0.25| 0.75| 0.108| 0.081| 4| 0|

FIFO MULTIPROGRAMMING W/ MEMORY REQUEST AND NO I/O OVERLAP

EXAMPLE # 4:
JOB| ARRIVAL TIME| RUN TIME| MEMORY NEEDED|
1| 10| 0.3| 10K|
2| 10.2| 0.5| 60K|
3| 10.4| 0.1| 50K|
4| 10.5| 0.4| 10K|
5| 10.8| 0.1| 30K|

TIME | EVENT| # OF JOBS| %CPU/JOB| ELAPSED TIME| HEADWAY/JOB| CORE AVAIL| JOB| TIME LEFT| 10| J1A/JIS| 0| 0| 0| 0| 90| 1| 0.3|
10.2| J2A/J2S| 1...
tracking img