Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 24
Q601:
In bounded buffer problem, the semaphore 'full' is initialized to _____.
A. n
B. 1
D. -1
Correct Answer:
C
Chapter: 24
Q602:
In bounded buffer problem, which semaphore provides mutual exclusion?
A. empty
B. full
C. mutex
D. buffer
Correct Answer:
C
Chapter: 24
Q603:
In bounded buffer problem, the consumer process first performs ______.
A. wait(empty)
B. wait(full)
C. signal(empty)
D. produce item
Correct Answer:
B
Chapter: 24
Q604:
The producer adds an item to the buffer after performing _____.
A. signal(mutex)
B. wait(mutex)
C. wait(full)
D. signal(full)
Correct Answer:
B
Chapter: 24
Q605:
In bounded buffer problem, which process is responsible for filling the buffer?
A. Consumer
B. Producer
C. Reader
D. Writer
Correct Answer:
B
Chapter: 24
Q606:
In bounded buffer problem, which process consumes the items from buffer?
A. Producer
B. Reader
C. Consumer
D. Writer
Correct Answer:
C
Chapter: 24
Q607:
Writers must have ______ access to the shared object.
A. shared
B. exclusive
C. none
D. mutual
Correct Answer:
B
Chapter: 24
Q608:
In readers-writers problem, the shared variable to track readers is _____.
A. readlock
B. writerlock
C. readcount
D. mutex
Correct Answer:
C
Chapter: 24
Q609:
In readers-writers problem, when the first reader enters, it must ______.
A. wait(mutex)
B. wait(wrt)
C. signal(mutex)
D. signal(wrt)
Correct Answer:
B
Chapter: 24
Q610:
In readers-writers problem, when the last reader exits, it must ______.
A. wait(mutex)
B. signal(wrt)
C. wait(wrt)
D. signal(mutex)
Correct Answer:
B
Chapter: 24
Q611:
In the first readers-writers problem, priority is given to ______.
A. writers
B. readers
C. both equally
D. mutex
Correct Answer:
B
Chapter: 24
Q612:
In second readers-writers problem, priority is given to ______.
A. writers
B. readers
C. mutex
D. semaphore
Correct Answer:
A
Chapter: 24
Q613:
In Dining Philosophers Problem, philosophers share ______.
A. books
B. chairs and bowls
C. tables and chopsticks
D. computer systems
Correct Answer:
C
Chapter: 24
Q614:
Each chopstick in Dining Philosophers Problem is represented by a ______.
A. buffer
B. semaphore
C. lock
D. queue
Correct Answer:
B
Chapter: 24
Q615:
In Dining Philosophers Problem, deadlock can happen when ______.
A. one philosopher is eating
B. all philosophers pick up their left chopstick first
C. philosophers talk to each other
D. all philosophers sleep
Correct Answer:
B
Chapter: 24
Q616:
The wait operation is used to ______ a chopstick.
A. release
B. grab
C. destroy
D. reset
Correct Answer:
B
Chapter: 24
Q617:
The signal operation is used to ______ a chopstick.
A. grab
B. pick up
C. release
D. drop
Correct Answer:
C
Chapter: 24
Q618:
A solution of Dining Philosophers Problem must avoid ______ and ______.
A. Deadlock and starvation
B. Full and empty
C. Producer and consumer
D. Mutex and semaphores
Correct Answer:
A
Chapter: 24
Q619:
The Dining Philosophers Problem is a classic example of ______.
A. Producer Consumer problem
B. Resource allocation problem
C. Buffer management problem
D. Semaphore counting problem
Correct Answer:
B
Chapter: 24
Q620:
wait(mutex); readcount++; if(readcount == 1) wait(wrt); signal(mutex); is the code for ______.
A. writer entry
B. reader entry
C. writer exit
D. reader exit
Correct Answer:
B