(Operating Systems) Consider a multiprogramming system with 4 processes, A, B, C
ID: 3753177 • Letter: #
Question
(Operating Systems)
Consider a multiprogramming system with 4 processes, A, B, C, and D that arrived at the same time. Processes A and B are CPU-bound ones, while processes C and D are I/O-bound ones. Their resources requirements are given in the table below. Assume that process A uses 80% of the CPU while running, process B uses 80% of the CPU while running, process C uses 10% of the CPU while executing I/O, and process D uses 10% of the CPU while executing I/O. Furthermore, assume processes C and D use their respective I/O devices 100% of the time while executing their I/O. The total memory available in the system to be used for all jobs is 250M (assume no virtual memory).
Answer the following questions:
(a) How long would it take until all the processes are done?
(b) Draw the utilization of the CPU, memory, Disk and printer over time?
(c) What are the average utilizations of the CPU, memory, disk and printer?
(d) What is the overall system throughput (in jobs/hr)?
(e) What is the mean response time (that is also the average turnaround time) for all processes?
Explanation / Answer
Part a
It would take 5 Minutes for A, 15 Minutes for B, 5 Minutes for C, and 10 Minutes for D.
5+15+5+10=35 Minutes
But if you see the memory available you will find that only 250M is available and combined memory of all processes is 340M so only. So out of 4 processes either C or D will be included later on after a process is completed and required equivalent memory is freed. If we include A, B, C in memory then it will take 25 minutes to complete and then D will be included in the memory. So instead we will include A, B, D as in this case C will be included in memory when A and B are completed which is 20 Minutes that is 5 Minutes less than A, B, C combination. So first A will be completed in 5 Minutes, then B will be completed in 15 Minutes. The total is 20 minutes and now C will be included in memory and D will be completed in 10 Minutes. At last C will be included and completed in 5 Minutes.
Part b
A takes 80% CPU, 40 M out of 250 M memory, disk and the printer 0% for the first 5 minutes.
B takes 80% CPU, 50 M out of 210 M memory, disk and the printer 0% from 5 to 20 minutes.
D takes 10% CPU, 100 M out of 160 M memory, 100% disk and 0% printer from 20 to 30 minutes.
C takes 10% CPU, 150 M out of 250 M memory, 100% disk and 100% printer from 20 to 35 minutes.
Part c
Average utilization of CPU
A used 80% for 5 min
B used 80% for 15 minutes
C used 10 % for 5 minutes
D used 10 % for 10 minutes
A CPU=80*(5/35)=11.43
B CPU=80*(15/35)=34.29
C CPU=10*(5/35)=1.43
D CPU=10*(10/35)=2.86
Average CPU=(11.43+34.29+1.43+2.86)=50.1%
Average utilization of memory
A 40M for 5 minutes
B 50M for 15 minutes
C 150 M for 5 minutes
D 100M for 10 minutes
A memory=40*(5/35)=5.71M
B memory=50*(15/35)=21.43M
C memory=150*(5/35)=21.43M
D memory=100*(10/35)=28.57M
Average memory utilization=(5.71+21.43+21.43+28.57) = 77.14M
Average utilization of disk
A 0% for 5 minutes
B 0% for 15 minutes
C 100% for 5 minutes
D 100% for 10 minutes
A disk=0
B disk=0
C disk=100*(5/35)=14.29
D disk=100*(10/35)=28.57
Average disk utilization=14.29+28.57=42.86%
Average printer utilization
A 0% for 5 minutes
B 0% for 15 minutes
C 0% for 5 minutes
D 100% for 10 minutes
A printer=0
B printer=0
C printer=0
D printer=100*(10/35)=28.57%
Average printer utilization = 28.57%
Part d
4 jobs are done in 35 minutes. So 35/4=8.75 minutes per job. So only 6 jobs can be done in 52.5 minutes and give us an extra 7.5 minutes per hour. Throughput is 6. If we take jobs worth 9 hours of time then the throughput will be 7.
Part e
As all the processes are completed in one go therefore their completion time is their turnaround time.
5+15+5+10=35
Average turnaround time=35/4=8.75 minutes.
Hope you have got all your answers.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.