Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 21
Q521:
In the TestAndSet pseudo-code, what type is the parameter 'target'?
A. integer
B. float
C. boolean
D. string
Correct Answer:
C
Chapter: 21
Q522:
The critical section problem mainly occurs when processes share ________.
A. independent code
B. private data
C. shared variables
D. local memory
Correct Answer:
C
Chapter: 21
Q523:
Critical section problem can be solved easily by disabling interrupts in ________.
A. multiprocessor systems
B. distributed systems
C. uniprocessor systems
D. cloud systems
Correct Answer:
C
Chapter: 21
Q524:
Which section follows immediately after leaving the critical section?
A. Entry section
B. Exit section
C. Remainder section
D. Initialization section
Correct Answer:
C
Chapter: 21
Q525:
What characteristic ensures that TestAndSet operations do not interfere with each other?
A. Parallel execution
B. Atomic execution
C. Random execution
D. Sequential execution
Correct Answer:
B
Chapter: 21
Q526:
What does the Swap instruction need apart from the global 'lock' variable?
A. A key variable for each process
B. An interrupt handler
C. Shared memory
D. Hardware support
Correct Answer:
A
Chapter: 21
Q527:
If two TestAndSet instructions execute at the same time, they are executed ______.
A. simultaneously
B. atomically in random order
C. sequentially in some order
D. delayed indefinitely
Correct Answer:
C
Chapter: 21
Q528:
What type of solution will be discussed in the next lecture according to the content?
A. Software-only solution
B. Hybrid cloud solution
C. Hardware-based good solution
D. Memory-mapping solution
Correct Answer:
C
Chapter: 21
Q529:
Which solution delays entry into critical sections due to message passing?
A. TSL solution
B. Disabling interrupts in multiprocessor
C. Swap instruction
D. Local variable key method
Correct Answer:
B
Chapter: 22
Q530:
Which hardware solution solves the critical section problem while satisfying all three conditions?
A. TestAndSet
B. Swap
C. Combined Algorithm 3
D. Semaphore
Correct Answer:
C
Chapter: 22
Q531:
In Algorithm 3, which data structures are used by cooperating processes?
A. waiting and lock
B. key and lock
C. mutex only
D. signal and wait
Correct Answer:
A
Chapter: 22
Q532:
The "TestAndSet" instruction must be executed ___________.
A. slowly
B. randomly
C. atomically
D. periodically
Correct Answer:
C
Chapter: 22
Q533:
In Algorithm 3, the critical section is entered when _______ becomes false.
A. waiting[i]
B. key
C. lock
D. both A and B
Correct Answer:
D
Chapter: 22
Q534:
In Algorithm 3, the value of 'key' becomes false by executing _______.
A. Swap
B. TestAndSet
C. Semaphore
D. Wait
Correct Answer:
B
Chapter: 22
Q535:
Which type of environment uses disabling interrupts for atomic execution?
A. Multiprocessor
B. Uniprocessor
C. Distributed
D. Cloud
Correct Answer:
B
Chapter: 22
Q536:
Semaphore is a(n) ________ variable used for synchronization.
A. Boolean
B. Character
C. Integer
D. Float
Correct Answer:
C
Chapter: 22
Q537:
In the classical definition of semaphore, "wait" operation was originally called _______.
A. S
B. P
C. W
D. V
Correct Answer:
B
Chapter: 22
Q538:
In the classical definition of semaphore, "signal" operation was originally called _______.
A. S
B. P
C. W
D. V
Correct Answer:
D
Chapter: 22
Q539:
Spinlocks are mainly useful when locks are held for _______.
A. long times
B. short times
C. infinite times
D. never
Correct Answer:
B
Chapter: 22
Q540:
Semaphore operations must be performed _______.
A. individually
B. atomically
C. partially
D. sequentially
Correct Answer:
B