1. What is the primary goal of mutual exclusion in parallel and distributed systems?
(A) Maximizing hardware diversity
(B) Achieving efficient load balancing
(C) Ensuring only one process accesses a critical section at a time
(D) Ignoring fault tolerance
2. Which property is essential for a mutual exclusion algorithm to be correct?
(A) Hardware diversity
(B) Progress
(C) Load balancing
(D) Fault tolerance
3. What does the term “critical section” refer to in the context of mutual exclusion?
(A) A section of code that executes without synchronization
(B) A section of code where shared resources are accessed
(C) Maximizing fault tolerance
(D) Ignoring load balancing
4. Which algorithm is based on the idea of “turns” to achieve mutual exclusion?
(A) Dekker’s algorithm
(B) Lamport’s bakery algorithm
(C) Peterson’s algorithm
(D) Fischer’s algorithm
5. In Lamport’s bakery algorithm, what does each process take before entering the critical section?
(A) A ticket number
(B) A shared lock
(C) A turn variable
(D) A priority number
6. Which algorithm uses “flags” and “turns” to achieve mutual exclusion?
(A) Dekker’s algorithm
(B) Peterson’s algorithm
(C) Lamport’s bakery algorithm
(D) Fischer’s algorithm
7. What is the primary purpose of the “turn” variable in Peterson’s algorithm?
(A) Indicating the priority of a process
(B) Ensuring progress in mutual exclusion
(C) Assigning tickets to processes
(D) Ignoring load balancing
8. In Fischer’s algorithm, how many processes can enter the critical section simultaneously?
(A) One
(B) Two
(C) Three
(D) Multiple
9. What is the primary goal of the “test-and-set” instruction in mutual exclusion algorithms?
(A) Maximizing hardware diversity
(B) Achieving efficient load balancing
(C) Ensuring progress in mutual exclusion
(D) Ignoring fault tolerance
10. Which algorithm is based on the idea of “flags” and “waiting” to achieve mutual exclusion?
(A) Dekker’s algorithm
(B) Peterson’s algorithm
(C) Lamport’s bakery algorithm
(D) Fischer’s algorithm
11. What does the term “busy waiting” refer to in the context of mutual exclusion?
(A) A process waiting for a turn variable
(B) A process repeatedly checking a condition in a loop
(C) Achieving load balancing
(D) Ignoring fault tolerance
12. In Lamport’s bakery algorithm, how are ties resolved between processes with the same ticket number?
(A) Based on their process ID
(B) Based on their priority
(C) Randomly
(D) Simultaneously
13. What is the role of the “interested” array in Fischer’s algorithm?
(A) Indicating which processes are interested in entering the critical section
(B) Assigning priority numbers to processes
(C) Managing the turn variable
(D) Ignoring load balancing
14. In Peterson’s algorithm, what is the purpose of the “flag” variables?
(A) Indicating which processes are interested in entering the critical section
(B) Managing the turn variable
(C) Assigning priority numbers to processes
(D) Ensuring progress in mutual exclusion
15. Which algorithm uses a “victim” variable to achieve mutual exclusion?
(A) Dekker’s algorithm
(B) Peterson’s algorithm
(C) Lamport’s bakery algorithm
(D) Fischer’s algorithm
16. In Fischer’s algorithm, what is the role of the “num” array?
(A) Managing the turn variable
(B) Indicating which processes are interested in entering the critical section
(C) Assigning priority numbers to processes
(D) Counting the number of processes in the critical section
17. What is the primary advantage of Lamport’s bakery algorithm?
(A) Simplicity and ease of understanding
(B) Minimal use of flags and turns
(C) Efficient handling of ties in ticket numbers
(D) Maximizing fault tolerance
18. In Peterson’s algorithm, what is the significance of the “turn” variable?
(A) Indicating which processes are interested in entering the critical section
(B) Managing the order in which processes enter the critical section
(C) Assigning priority numbers to processes
(D) Counting the number of processes in the critical section
19. What is the primary disadvantage of busy waiting in mutual exclusion algorithms?
(A) Inefficient use of system resources
(B) Efficient load balancing
(C) Maximizing fault tolerance
(D) Simplicity and ease of understanding
20. In Fischer’s algorithm, what is the purpose of the “turn” variable?
(A) Indicating which processes are interested in entering the critical section
(B) Managing the order in which processes enter the critical section
(C) Assigning priority numbers to processes
(D) Counting the number of processes in the critical section
21. Which algorithm is known for its simplicity and avoidance of busy waiting?
(A) Dekker’s algorithm
(B) Peterson’s algorithm
(C) Lamport’s bakery algorithm
(D) Fischer’s algorithm
22. What is the primary purpose of the “turn” variable in Fischer’s algorithm?
(A) Indicating which processes are interested in entering the critical section
(B) Managing the order in which processes enter the critical section
(C) Assigning priority numbers to processes
(D) Counting the number of processes in the critical section
23. In Peterson’s algorithm, how are ties between processes with the same priority resolved?
(A) Based on their process ID
(B) Based on the turn variable
(C) Randomly
(D) Simultaneously
24. What is the primary focus of Lamport’s bakery algorithm?
(A) Maximizing hardware diversity
(B) Efficient load balancing
(C) Achieving progress in mutual exclusion
(D) Avoiding busy waiting
25. In Fischer’s algorithm, what is the role of the “choosing” array?
(A) Indicating which processes are interested in entering the critical section
(B) Managing the order in which processes enter the critical section
(C) Avoiding busy waiting
(D) Assigning priority numbers to processes
26. What is the primary purpose of the “interested” array in Peterson’s algorithm?
(A) Managing the order in which processes enter the critical section
(B) Avoiding busy waiting
(C) Indicating which processes are interested in entering the critical section
(D) Assigning priority numbers to processes
27. In Fischer’s algorithm, how are ties between processes with the same priority resolved?
(A) Based on their process ID
(B) Based on the turn variable
(C) Randomly
(D) Simultaneously
28. What is the primary disadvantage of busy waiting in mutual exclusion algorithms?
(A) Efficient load balancing
(B) Inefficient use of system resources
(C) Simplicity and ease of understanding
(D) Maximizing fault tolerance
29. In Peterson’s algorithm, what is the role of the “victim” variable?
(A) Managing the order in which processes enter the critical section
(B) Avoiding busy waiting
(C) Indicating which processes are interested in entering the critical section
(D) Assigning priority numbers to processes
30. Which algorithm is known for its avoidance of busy waiting and simplicity?
(A) Dekker’s algorithm
(B) Peterson’s algorithm
(C) Lamport’s bakery algorithm
(D) Fischer’s algorithm