0% found this document useful (0 votes)
161 views

I Job Scheduling in Non-Multiprogramming Environment

The document describes job scheduling algorithms in a non-multiprogramming environment, including first-in first-out (FIFO) scheduling. It provides examples of calculating average turnaround time for FIFO scheduling without and with multiprogramming. It also discusses scheduling with memory and I/O constraints like tape drives. The examples show the job arrival times, run times, and required memory and I/O to calculate scheduling metrics like wait time, percentage of CPU per job, and headway per job.

Uploaded by

Jeannand Marcial
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
161 views

I Job Scheduling in Non-Multiprogramming Environment

The document describes job scheduling algorithms in a non-multiprogramming environment, including first-in first-out (FIFO) scheduling. It provides examples of calculating average turnaround time for FIFO scheduling without and with multiprogramming. It also discusses scheduling with memory and I/O constraints like tape drives. The examples show the job arrival times, run times, and required memory and I/O to calculate scheduling metrics like wait time, percentage of CPU per job, and headway per job.

Uploaded by

Jeannand Marcial
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

i

JOB SCHEDULING IN
NON-MULTIPROGRAMMING ENVIRONMENT

Average turn around time computation

Where:
=

= Finish Time
= Arrival Time
n = no. of jobs

= Start Time
= Run Time

= Weighted turn around time

EXAMPLE # 1: FIFO

JOB

ARRIVAL TIME

RUN TIME

10.00

2.00

10.10

1.00

10.25

0.25

ANSWER:

JOB NO. ARRIVAL TIME START TIME FINISH TIME

TAT

WTAT

10

10.00

12.00

2.00

1.00

10.10

12.00

13.00

2.90

2.90

10.25

13.00

13.25

12.00

12.00

FIFO MULTIPROGRAMMING W/ NO I/O OVERLAP

HEADWAY = Amount of CPU spent on a job


HEADWAY/JOB = (%CPU/JOB)(ELAPSED TIME)
%CPU/JOB = = Reciprocal of the no. of job
ELAPSED TIME = Time of Consideration
= Current time Previous Time

EXAMPLE # 2:
JOB
1
2
3
4
5

ARRIVAL TIME
10.00
10.20
10.40
10.50
10.80

RUN TIME
0.3
0.5
0.1
0.4
0.1

TIME
10.00
10.20

EVENT
J1A
J2A

# OF JOBS
0
1

%CPU/JOB
0
1

ELAPSED TIME
0
0.20

HEADWAY/JOB
0
0.20

10.40

JIT
J3A

0.5

0.2

0.10

10.50

J4A

0.5

0.1

0.05

10.65

J3T

0.33

0.15

0.05

10.80

J5A

0.50

0.15

0.075

11.10

J5T

0.333

0.30

0.10

11.35

J2T

0.5

0.25

0.125

11.40

J4T

0.05

0.05

JOB
1
2
1
2
1
3
4
3
2
4
3
2
5
4
2
5
4
2
4
2
4

TIME LEFT
0.3
0.5
0.1
0.4
0
0.1
0.4
0.05
0.35
0.35
0
0.3
0.1
0.275
0.225
0
0.175
0.125
0.05
0
0

FIFO MUTIPROGRAMMING W/ I/O OVERLAP


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

%CPU/JOB =

NOTE: CPU Utilization is 75% of Runtime


EXAMPLE # 3
JOB
1
2
3
4
5

ARRIVAL TIME
10
10.2
10.4
10.5
10.8

RUN TIME
0.3
0.5
0.1
0.4
0.1

# OF JOBS

CPU WAIT

0.25

0.04

TIME
10.000
10.200

EVENT
J1A
J2A

# OF JOBS
0
1

CPU WAIT
0
0.25

%CPU/JOB
0
0.75

ELAPSED TIME
0
0.2

HEADWAY/JOB
0
0.15

10.356

J1T

0.04

0.48

0.156

0.075

10.400

J3A

0.25

0.75

0.044

0.033

10.500

J4A

0.04

0.48

0.1

0.048

10.581

J3T

0.333

0.081

0.027

10.800

J5A

0.04

0.48

0.219

0.105

11.025

J5T

0.333

0.225

0.075

11.05

J3T

0.04

0.48

0.025

0.012

11.158

J4T

0.25

0.75

0.108

0.081

JOB
1
2
1
1
2
3
2
4
3
2
4
3
2
5
4
2
5
4
2
2
4
4

CPU TIME
NEEDED
0.225
0.375
0.075
0
0.3
0.075
0.267
0.3
0.027
0.219
0.273
0
0.192
0.075
0.168
0.087
0
0.093
0.012
0
0.081
0

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


EXAMPLE # 4:
JOB
1
2
3
4
5

ARRIVAL TIME
10
10.2
10.4
10.5
10.8

RUN TIME
0.3
0.5
0.1
0.4
0.1

MEMORY NEEDED
10K
60K
50K
10K
30K

ANSWER:
TIME
10
10.2

EVENT
J1A/JIS
J2A/J2S

# OF JOBS
0
1

%CPU/JOB
0
1

ELAPSED TIME
0
0.2

HEADWAY/JOB
0
0.2

CORE
AVAIL
90
30

10.4

J1T/J3A

0.5

0.2

0.1

40

10.5

J4A/J4S

0.5

0.1

0.05

30

10.8

J5A/J5S

0.33

0.3

0.099

11.2

J5T

0.25

0.4

0.1

30

11.658

J2T/J3S

0.33

0.458

0.151

40

11.758

J4T

0.5

0.1

0.05

50

11.808

J3T

0.05

0.05

100

JOB
1
2
1
1
2
3
4
3
2
5
4
3
2
5
4
3
2
2
3
4
4
3
3

TIME LEFT
0.3
0.5
0.1
0
0.4
0.1
0.4
0.1
0.35
0.1
0.301
0.001
0.25
0
0.201
0.1
0.151
0
0.1
0.05
0
0.05
0

FIFO MULTIPROGRAMMING W/ MEMORY and TAPE NEEDED AND NO I/O


OVERLAP
EXAMPLE # 5 (assume that the system has memory= 100k & tape= 5
JOB
1
2
3
4
5

ARRIVAL TIME
10
10.2
10.4
10.5
10.8

RUN TIME
0.3
0.5
0.1
0.4
0.1

MEMORY NEEDED
10K
60K
50K
10K
30K

TAPE NEEDED
2
1
4
3
2

ANSWER:
EVENT
J1A

# OF JOBS
0

% CPU/JOB
0

ELAPSED
TIME
0

HEADWAY/JOB
0

CORE AVAIL
90

JOB
1

TIME LEFT
0.3

TAPE AVAIL
3

J2A
J2S
J1T
J3A

0.2

0.2

30

0.5

0.2

0.1

40

J4A
J4S

0.5

0.1

0.05

30

10.8

J5A

0.33

0.3

0.099

30

11.804

J2T

0.25

1.004

0.251

90
60

11.954

J4T

0.33

0.15

0.05

70

12.054

J5T

0.5

0.1

0.05

12.154

J3T

0.1

0.1

100
50
100

0.5
0.1
0
0.4
0.1
0.4
0.35
0.1
0.1
0.301
0.251
0.1
0.1
0.05
0.1
0
0
0.05
0.1
0
0.1
0

2
1
1
2
3
4
2
3
5
4
2
3
5
4
3
2
4
5
3
5
3
3

TIME
10
J1S
10.2
10.4

10.5

2
2

3
0

5
1
5

You might also like