0% found this document useful (0 votes)
12 views9 pages

اختبار 7

The document consists of a series of questions and answers related to CPU scheduling, synchronization mechanisms, and process management concepts. Key topics include CPU burst, scheduling algorithms, critical sections, semaphores, and the Readers-Writers problem. Each question is followed by the correct answer, providing a concise overview of essential computer science principles.

Uploaded by

Ayman AlAbsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

اختبار 7

The document consists of a series of questions and answers related to CPU scheduling, synchronization mechanisms, and process management concepts. Key topics include CPU burst, scheduling algorithms, critical sections, semaphores, and the Readers-Writers problem. Each question is followed by the correct answer, providing a concise overview of essential computer science principles.

Uploaded by

Ayman AlAbsi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1. What is the main goal of CPU scheduling?


• A. To minimize memory usage

• B. To maximize CPU utilization

• C. To optimize storage allocation

• D. To minimize network latency


Answer: B

2. Which of the following describes a CPU burst?

• A. A period of I/O activity

• B. A time when the CPU is idle

• C. A cycle of CPU execution

• D. A period of context switching


Answer: C

3. What is the main concern in CPU burst distribution?

• A. Memory allocation

• B. Disk usage

• C. CPU burst length

• D. System temperature
Answer: C

4. When does non-preemptive scheduling occur?

• A. When a process switches to the waiting state

• B. When a process is terminated

• C. During interrupts

• D. When the CPU is idle


Answer: A

5. What is dispatch latency?

• A. Time taken for I/O operations

• B. Time taken to stop one process and start another


• C. Duration of a context switch

• D. Execution time of a process


Answer: B

6. What does "throughput" measure in CPU scheduling?

• A. Number of I/O operations per second

• B. Number of processes completed per unit time

• C. Average waiting time of processes

• D. Response time of processes


Answer: B

7. Which scheduling algorithm causes a convoy effect?

• A. First-Come, First-Served (FCFS)

• B. Shortest-Job-First (SJF)

• C. Priority Scheduling

• D. Round Robin (RR)


Answer: A

8. What is a drawback of Priority Scheduling?

• A. High waiting time

• B. Starvation of low-priority processes

• C. High CPU utilization

• D. Complex implementation
Answer: B

9. In Round Robin scheduling, what is "q"?

• A. Process priority

• B. Time quantum

• C. CPU burst

• D. Turnaround time
Answer: B

10. Which scheduling algorithm is best for minimizing average waiting time?
• A. First-Come, First-Served (FCFS)

• B. Round Robin (RR)

• C. Shortest-Job-First (SJF)

• D. Multilevel Queue
Answer: C

11. What does the dispatcher module do?

• A. Manages memory allocation

• B. Allocates CPU to processes in the ready queue

• C. Handles I/O devices

• D. Schedules background processes


Answer: B

12. What is a critical section?

• A. Part of the code executed only once

• B. A segment of code that accesses shared resources

• C. A process waiting for CPU

• D. A section of memory allocated to a process


Answer: B

13. Which of the following is NOT a requirement for solving the Critical Section Problem?

• A. Mutual exclusion

• B. Progress

• C. Bounded waiting

• D. Unlimited resources
Answer: D

14. What does Peterson’s Solution use for synchronization?

• A. Semaphores

• B. Locks

• C. Turn and flag variables

• D. Monitors
Answer: C
15. What does the semaphore operation 'wait(S)' do?

• A. Increments the semaphore value

• B. Decrements the semaphore value

• C. Blocks a process until the semaphore is available

• D. Initializes the semaphore


Answer: C

16. What is the result of a deadlock?

• A. Processes complete execution without waiting

• B. Processes are blocked indefinitely

• C. CPU utilization increases

• D. Memory usage decreases


Answer: B

17. What problem arises in Priority Scheduling without aging?

• A. Low throughput

• B. Starvation

• C. High response time

• D. High CPU utilization


Answer: B

18. Which scheduling algorithm is used in Multilevel Queue scheduling for foreground
processes?

• A. FCFS

• B. Round Robin

• C. Priority

• D. Shortest-Job-First
Answer: B

19. What happens during context switching?

• A. CPU is idle

• B. Process executes its critical section


• C. CPU state is saved and restored for a process

• D. Disk scheduling occurs


Answer: C

20. In the Readers-Writers problem, what ensures mutual exclusion?

• A. Locks

• B. Mutex and semaphore variables

• C. Turn variable

• D. Priority scheduling
Answer: B

‫سأكمل بقية األسئلة اآلن‬.

40 ‫ إلى‬21 ‫األسئلة من‬:

21. What does bounded waiting ensure in the Critical Section problem?

• A. No process waits indefinitely

• B. Processes execute in a fixed order

• C. All processes enter the critical section simultaneously

• D. Mutual exclusion is maintained


Answer: A

22. What is a counting semaphore used for?

• A. Controlling access to multiple instances of a resource

• B. Ensuring mutual exclusion

• C. Managing process scheduling

• D. Preventing starvation
Answer: A

23. What happens if a process tries to access a full buffer in the Producer-Consumer
problem?

• A. The process is terminated

• B. The process is blocked

• C. The buffer is overwritten


• D. The buffer is cleared
Answer: B

24. What type of processes does the Readers-Writers problem differentiate?

• A. Interactive and background processes

• B. Single-threaded and multi-threaded processes

• C. Readers and writers

• D. Preemptive and non-preemptive processes


Answer: C

25. What is the main drawback of busy waiting?

• A. High memory usage

• B. Wasted CPU cycles

• C. Increased turnaround time

• D. Low response time


Answer: B

26. Which scheduling algorithm divides processes based on priority?

• A. Multilevel Queue

• B. Round Robin

• C. Shortest-Job-First

• D. First-Come, First-Served
Answer: A

27. What is the time quantum in Round Robin scheduling?

• A. Maximum burst time of processes

• B. Minimum burst time of processes

• C. Fixed time slice assigned to each process

• D. The average waiting time of processes


Answer: C

28. What does a semaphore’s initial value represent?

• A. The maximum number of processes allowed


• B. The current state of the semaphore

• C. The number of resources available

• D. The ID of the controlling process


Answer: C

29. Which problem does starvation lead to?

• A. Deadlock

• B. Infinite execution

• C. Resource contention

• D. Indefinite blocking
Answer: D

30. What is the average waiting time in the example of FCFS (P1: 24, P2: 3, P3: 3)?

• A. 15

• B. 20

• C. 17

• D. 10
Answer: C

31. In the SJF scheduling example, what is the average waiting time for (P1: 6, P2: 8, P3: 7,
P4: 3)?

• A. 5

• B. 6

• C. 7

• D. 8
Answer: C

32. What is aging used for in Priority Scheduling?

• A. To reduce response time

• B. To prevent starvation

• C. To improve throughput

• D. To optimize context switching


Answer: B
33. What does a dispatcher NOT do?

• A. Switch context

• B. Switch to user mode

• C. Restart the user program

• D. Allocate memory
Answer: D

34. Which synchronization mechanism uses atomic operations?

• A. Semaphore

• B. Mutex locks

• C. Peterson’s Solution

• D. Both A and B
Answer: D

35. What is the priority of system processes in Multilevel Queue scheduling?

• A. Low

• B. Medium

• C. High

• D. Variable
Answer: C

36. Which problem is tested using the Bounded-Buffer Problem?

• A. Deadlock

• B. Synchronization

• C. Starvation

• D. Context switching
Answer: B

37. How is mutual exclusion achieved in the Readers-Writers problem?

• A. Using mutex and semaphore

• B. With busy waiting


• C. By using multiple locks

• D. Through process priorities


Answer: A

38. What type of scheduling does the background queue in Multilevel Queue use?

• A. Round Robin

• B. First-Come, First-Served

• C. Shortest-Job-First

• D. Priority
Answer: B

39. What ensures no writer enters the critical section if there’s a reader in the Readers-
Writers problem?

• A. Mutex variable

• B. WRT semaphore

• C. Reader counter

• D. Priority scheduling
Answer: B

40. What is the result of initializing a binary semaphore to 1?

• A. The resource is free

• B. The resource is in use

• C. No process can access the resource

• D. The semaphore is disabled


Answer: A

You might also like