0% found this document useful (0 votes)
8 views10 pages

Soalan Cpu Real

The document discusses CPU scheduling, including definitions, types of scheduling (preemptive and non-preemptive), and various scheduling criteria such as CPU utilization and turnaround time. It includes multiple-choice questions and calculations related to waiting time and turnaround time for different scheduling algorithms like FCFS, SJF, and Priority Scheduling. The document serves as a study guide for understanding CPU scheduling concepts and their applications.

Uploaded by

2023406116
Copyright
© © All Rights Reserved
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)
8 views10 pages

Soalan Cpu Real

The document discusses CPU scheduling, including definitions, types of scheduling (preemptive and non-preemptive), and various scheduling criteria such as CPU utilization and turnaround time. It includes multiple-choice questions and calculations related to waiting time and turnaround time for different scheduling algorithms like FCFS, SJF, and Priority Scheduling. The document serves as a study guide for understanding CPU scheduling concepts and their applications.

Uploaded by

2023406116
Copyright
© © All Rights Reserved
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/ 10

SOALAN CPU

1. What is CPU scheduling?


Answer A : CPU scheduling is the basis of multiprogrammed operating systems by switching
the CPU processes, the operating system can make the computer more productive.
- B . CPU scheduling is the basis of a programmed operating systems by switching the CPU
processes, the operating system can make the computer more productive

2. Process exucation begins with I/O burst followed by CPU burst


Answer: false

3. Process execution consists of :


Answer : (multiple choice question)
- CPU execution *
- CPU burst
- I/O burst
- I/O wait *

4. There are 3 queue :


Answer (multiple choices) :
- job queue*
- ready queue *
- start queue
- process queue *

5. CPU scheduling decisions may take place when a process :


- 1.Switches from running to wasting state
- 2.Switches from running to ready waste
- 3.Switches from waiting to ready state
- 4.Terminates
- A) 1,3
- B) 2,3
- C) 1,4
- D) all of above (answer)

6. There are two types of scheduling which are preemptive and non-preemptive
Answer : True

7. There are 3 types of nonpreemptive scheduling


- FCFS *
- SRT
- SJF *
- Priority nonpreemptive*

8. There are 3 types of preemptive scheduling


- Round Robbin(RR) *
- SJF
- SRT *
- Priority preemptive *

9. In scheduling criteria, what is the meaning of below statement :

“ keep the CPU as busy as possible “


- Response time
- Waiting time
- Turnaround time
- Throughput
- CPU utilization *

10. In scheduling criteria, what is the meaning of below statement :

“ # of processes that complete their execution “


- Response time
- Waiting time
- Turnaround time
- Throughput *
- CPU utilization

11. In scheduling criteria, what is the meaning of below statement :

“ amount of time time to execute a particular process “


- Response time
- Waiting time
- Turnaround time *
- Throughput
- CPU utilization

12. In scheduling criteria, what is the meaning of below statement :

“ amount of time a process has been waiting in the rady queue “


- Response time
- Waiting time *
- Turnaround time
- Throughput
- CPU utilization

13. In scheduling criteria, what is the meaning of below statement :

“ amount of time it takes from when a request was submitted until the first response is
produced “
- Response time *
- Waiting time
- Turnaround time
- Throughput
- CPU utilization

14. Choose the correct algorithm optimization criteria

A) Min waiting time


Max CPU utilization
Min response time
Max throughput
Min turnaround time

B) Min waiting time


Max CPU utilization
Min throughput
Min turnaround time
Max response time

C) Max throughput
Max waiting time
Min turnaround time
Min CPU utilization
Min response time
15. In FCFS Scheduling (non preemptive) based on Process and Burst Time given:

Calculate:
-Waiting time
- Average waiting time
Process Burst Time (millisecond)
P1 20
P2 5
P3 3

A) Waiting Time P1 :1
Waiting Time P2 : 20
Waiting Time P3 : 25

Average waiting time: 15.33


B) Waiting Time P1 : 0
Waiting Time P2 :20
Waiting Time P3 :25

Average waiting time: 15


C) Waiting Time P1 :20
Waiting Time P2 :5
Waiting Time P3 :3

Average waiting time: 9.33


D) Waiting Time P1 :0
Waiting Time P2 :20
Waiting Time P3 :5

Average waiting time: 8.33


16. In FCFS Scheduling (nonpreemptive) based on Process and Burst Time given:

Calculate:
- Turnaround time
- Average turnaround time
Process Burst Time (millisecond)
P1 20
P2 5
P3 3

A) Turnaround time P1= 0


Turnaround time P2=20
Turnaround time P3=25

Average turnaround time = 15


B) Turnaround time P1= 21
Turnaround time P2= 25
Turnaround time P3= 28

Average turnaround time = 24.67


C) Turnaround time P1= 21
Turnaround time P2= 26
Turnaround time P3= 29

Average turnaround time = 25.33


D) Turnaround time P1= 20
Turnaround time P2= 25
Turnaround time P3= 28

Average turnaround time = 24.33


17. In SJF Scheduling (nonpreemptive) based on Process and Burst Time given:

Process Burst Time (millisecond)


P1 5
P2 7
P3 6
P4 2

Which of the Gantt Chart is the correct turnaround time:

Answer : A
18.In SJF Scheduling (nonpreemptive) based on Process and Burst Time given:

Process Burst Time (millisecond)


P1 5
P2 7
P3 6
P4 2

Calculate:
- Waiting time
- Average waiting time

A) Waiting Time P1 :13


Waiting Time P2 : 7
Waiting Time P3 : 2
Waiting Time P4: 0

Average waiting time: 5.5


B) Waiting Time P1 : 2
Waiting Time P2 : 13
Waiting Time P3 : 7
Waiting Time P4: 0

Average waiting time: 5.5


C) Waiting Time P1 : 0
Waiting Time P2 : 2
Waiting Time P3 : 7
Waiting Time P4: 13

Average waiting time: 5.5


D) Waiting Time P1 : 7
Waiting Time P2 : 13
Waiting Time P3 : 2
Waiting Time P4: 0

Average waiting time: 5.5


19. In Priority Scheduling (nonpreemptive) based on Process, Burst Time and Priority given:

Process Burst Time Priority


P1 11 3
P2 5 1
P3 2 4
P4 5 5
P5 8 2

Calculate:

- Waiting time
- Average waiting time

A) Waiting Time P1 :13


Waiting Time P2 : 24
Waiting Time P3 : 0
Waiting Time P4: 5
Waiting Time P5: 26

Average waiting time: 13.6


B) Waiting Time P1 : 0
Waiting Time P2 : 13
Waiting Time P3 : 26
Waiting Time P4: 24
Waiting Time P5: 5

Average waiting time: 14.6


C) Waiting Time P1 : 5
Waiting Time P2 : 26
Waiting Time P3 : 24
Waiting Time P4: 0
Waiting Time P5: 13

Average waiting time: 14.6


D) Waiting Time P1 : 13
Waiting Time P2 : 0(
Waiting Time P3 : 24
Waiting Time P4: 26
Waiting Time P5: 5

Average waiting time: 13.6

20. In Priority Scheduling (nonpreemptive) based on Process, Burst Time and Priority given:

Process Burst Time Priority


P1 11 3
P2 5 1
P3 2 4
P4 5 5
P5 8 2

Calculate:

- Turnaround time
- Average turnaround time

A) Turnaround time:
P1=24
P2=5
P3=26
P4=31
P5=13

Average turnaround time=19.8


B) Turnaround time:
P1=24
P2=26
P3=31
P4=5
P5=13

Average turnaround time=19.8


C) Turnaround time:
P1=26
P2=5
P3=24
P4=13
P5=31

Average turnaround time= 19.8


D) Turnaround time:
P1=26
P2=31
P3=24
P4=5
P5=13

Average turnaround time=19.8

You might also like