Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 22
Q561:
The "mutex" semaphore ensures _______.
A. Parallel processing
B. Data loss
C. Mutual exclusion
D. Memory sharing
Correct Answer:
C
Chapter: 23
Q562:
What is the main disadvantage of traditional semaphores?
A. High memory usage
B. Busy waiting
C. Complex syntax
D. Slow processing
Correct Answer:
B
Chapter: 23
Q563:
What is another name for a semaphore that causes busy waiting?
A. Deadlock
B. Starvation
C. Spinlock
D. Mutex
Correct Answer:
C
Chapter: 23
Q564:
Spinlocks are particularly useful in ______ systems.
A. Single-processor
B. Batch processing
C. Multiprocessor
D. Sequential
Correct Answer:
C
Chapter: 23
Q565:
In semaphores, busy waiting wastes which resource?
A. Memory
B. CPU cycles
C. Disk space
D. Network bandwidth
Correct Answer:
B
Chapter: 23
Q566:
The block operation places a process into _______.
A. Execution queue
B. Waiting queue
C. Memory pool
D. CPU register
Correct Answer:
B
Chapter: 23
Q567:
The wakeup operation changes the process state from ______ to ready.
A. Running
B. Waiting
C. Blocked
D. Terminated
Correct Answer:
B
Chapter: 23
Q568:
In the semaphore struct, 'value' represents _______.
A. CPU cycles
B. Queue length
C. Available resources
D. Program counter
Correct Answer:
C
Chapter: 23
Q569:
What is the correct initial value for a semaphore used to synchronize two processes?
A. 1
B. -1
D. 2
Correct Answer:
C
Chapter: 23
Q570:
A negative value of the semaphore indicates ______.
A. Number of active processes
B. Number of processes waiting
C. Number of signals
D. CPU cycles wasted
Correct Answer:
B
Chapter: 23
Q571:
Busy-waiting semaphores are better for ______ critical sections.
A. Very long
B. Short
C. Infinite
D. Nested
Correct Answer:
B
Chapter: 23
Q572:
In wait operation, if S.value is less than 0, the process is ______.
A. Executed immediately
B. Blocked
C. Deleted
D. Duplicated
Correct Answer:
B
Chapter: 23
Q573:
In signal operation, if S.value is less than or equal to 0, a process is ______.
A. Terminated
B. Added to ready queue
C. Removed from CPU
D. Blocked again
Correct Answer:
B
Chapter: 23
Q574:
In coding with semaphores, which operation should be called after a successful execution of a critical section?
A. wait(S)
B. signal(S)
C. block()
D. wakeup()
Correct Answer:
B
Chapter: 23
Q575:
If two processes each hold a resource and wait for the other’s resource, it causes ______.
A. Starvation
B. Deadlock
C. Busy waiting
D. Spinlock
Correct Answer:
B
Chapter: 23
Q576:
Infinite blocking caused by unavailability of resources is called ______.
A. Deadlock
B. Starvation
C. Semaphore
D. Spinlock
Correct Answer:
B
Chapter: 23
Q577:
Which problem occurs when a process never gets access to the required resource?
A. Deadlock
B. Starvation
C. Deadlock and Starvation
D. Mutual Exclusion
Correct Answer:
B
Chapter: 23
Q578:
Violation of mutual exclusion occurs if two processes ______.
A. Block each other
B. Execute wait and signal incorrectly
C. Use spinlocks
D. Ignore wakeup signals
Correct Answer:
B
Chapter: 23
Q579:
Which structure contains the list of waiting processes in semaphore?
A. CPU
B. Memory
C. Semaphore struct
D. Disk
Correct Answer:
C
Chapter: 23
Q580:
In a spinlock, no _______ is required.
A. CPU
B. Context switch
C. Memory access
D. Semaphore
Correct Answer:
B