Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q511: In the Swap instruction, what happens first?
- A: Memory lock
- B: Values are compared
- C: Values are swapped
- D: lock is set true
View Answer
C
Q512: In Swap-based mutual exclusion, each process has a local variable called ______.
- A: gate
- B: lock
- C: key
- D: switch
View Answer
C
Q513: In Swap-based solution, what is initialized to false globally?
- A: key
- B: lock
- C: temp
- D: status
View Answer
B
Q514: Which two hardware instructions are discussed to solve the critical section problem?
- A: Load and Store
- B: TestAndSet and Swap
- C: Swap and Load
- D: Read and Write
View Answer
B
Q515: The TestAndSet instruction performs which two actions atomically?
- A: Write and delete
- B: Save and set
- C: Swap and check
- D: Load and clear
View Answer
B
Q516: The Swap instruction swaps the values of two ______ variables.
- A: integer
- B: boolean
- C: float
- D: character
View Answer
B
Q517: Which of the following is NOT achieved by the TestAndSet based solution?
- A: Mutual exclusion
- B: Progress
- C: Bounded waiting
- D: Atomicity
View Answer
C
Q518: In the TestAndSet function, what is returned?
- A: New value of target
- B: Saved value of target
- C: Reference of target
- D: NULL
View Answer
B
Q519: TestAndSet and Swap are examples of ________ hardware instructions.
- A: synchronized
- B: asynchronous
- C: atomic
- D: random
View Answer
C
Q520: After executing the Swap function, what happens to 'a'?
- A: It holds the value of 'b'
- B: It holds the value of 'temp'
- C: It remains unchanged
- D: It gets a new random value
View Answer
A