Deck 12: Semaphores, Spinlocks, and Monitors: Understanding Synchronization in Operating Systems
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 12: Semaphores, Spinlocks, and Monitors: Understanding Synchronization in Operating Systems
1
Semaphore is a/an___________to solve the critical section problem.
A)hardware for a system
B)special program for a system
C)integer variable
D)none of the mentioned
A)hardware for a system
B)special program for a system
C)integer variable
D)none of the mentioned
integer variable
2
What are the two atomic operations permissible on semaphores?
A)wait
B)stop
C)hold
D)none of the mentioned
A)wait
B)stop
C)hold
D)none of the mentioned
wait
3
What are Spinlocks?
A)cpu cycles wasting locks over critical sections of programs
B)locks that avoid time wastage in context switches
C)locks that work better on multiprocessor systems
D)all of the mentioned
A)cpu cycles wasting locks over critical sections of programs
B)locks that avoid time wastage in context switches
C)locks that work better on multiprocessor systems
D)all of the mentioned
all of the mentioned
4
What is the main disadvantage of spinlocks?
A)they are not sufficient for many process
B)they require busy waiting
C)they are unreliable sometimes
D)they are too complex for programmers
A)they are not sufficient for many process
B)they require busy waiting
C)they are unreliable sometimes
D)they are too complex for programmers
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
The wait operation of the semaphore basically works on the basic___________system call.
A)stop()
B)block()
C)hold()
D)wait()
A)stop()
B)block()
C)hold()
D)wait()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
The signal operation of the semaphore basically works on the basic___________system call.
A)continue()
B)wakeup()
C)getup()
D)start()
A)continue()
B)wakeup()
C)getup()
D)start()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
If the semaphore value is negative
A)its magnitude is the number of processes waiting on that semaphore
B)it is invalid
C)no operation can be further performed on it until the signal operation is performed on it
D)none of the mentioned
A)its magnitude is the number of processes waiting on that semaphore
B)it is invalid
C)no operation can be further performed on it until the signal operation is performed on it
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
The code that changes the value of the semaphore is___________
A)remainder section code
B)non - critical section code
C)critical section code
D)none of the mentioned
A)remainder section code
B)non - critical section code
C)critical section code
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
What will happen if a non-recursive mutex is locked more than once?
A)starvation
B)deadlock
C)aging
D)signaling
A)starvation
B)deadlock
C)aging
D)signaling
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
What is a semaphore?
A)is a binary mutex
B)must be accessed from only one process
C)can be accessed from multiple processes
D)none of the mentioned
A)is a binary mutex
B)must be accessed from only one process
C)can be accessed from multiple processes
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
What are the two kinds of semaphores?
A)mutex & counting
B)binary & counting
C)counting & decimal
D)decimal & binary
A)mutex & counting
B)binary & counting
C)counting & decimal
D)decimal & binary
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
What is a mutex?
A)is a binary mutex
B)must be accessed from only one process
C)can be accessed from multiple processes
D)none of the mentioned
A)is a binary mutex
B)must be accessed from only one process
C)can be accessed from multiple processes
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
A binary semaphore is a semaphore with integer values
A)1
B)-1
C)0.8
D)0.5
A)1
B)-1
C)0.8
D)0.5
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
Semaphores are mostly used to implement
A)system calls
B)ipc mechanisms
C)system protection
D)none of the mentioned
A)system calls
B)ipc mechanisms
C)system protection
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
The bounded buffer problem is also known as___________
A)readers - writers problem
B)dining - philosophers problem
C)producer - consumer problem
D)none of the mentioned
A)readers - writers problem
B)dining - philosophers problem
C)producer - consumer problem
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
In the bounded buffer problem, there are the empty and full semaphores that
A)count the number of empty and full buffers
B)count the number of empty and full memory spaces
C)count the number of empty and full queues
D)none of the mentioned
A)count the number of empty and full buffers
B)count the number of empty and full memory spaces
C)count the number of empty and full queues
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
To ensure difficulties do not arise in the readers - writers problem___________are given exclusive access to the shared object.
A)readers
B)writers
C)readers and writers
D)none of the mentioned
A)readers
B)writers
C)readers and writers
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
The dining - philosophers problem will occur in case of___________
A)5 philosophers and 5 chopsticks
B)4 philosophers and 5 chopsticks
C)3 philosophers and 5 chopsticks
D)6 philosophers and 5 chopsticks
A)5 philosophers and 5 chopsticks
B)4 philosophers and 5 chopsticks
C)3 philosophers and 5 chopsticks
D)6 philosophers and 5 chopsticks
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
A deadlock free solution to the dining philosophers problem___________
A)necessarily eliminates the possibility of starvation
B)does not necessarily eliminate the possibility of starvation
C)eliminates any possibility of any kind of problem further
D)none of the mentioned
A)necessarily eliminates the possibility of starvation
B)does not necessarily eliminate the possibility of starvation
C)eliminates any possibility of any kind of problem further
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
A monitor is a type of___________
A)semaphore
B)low level synchronization construct
C)high level synchronization construct
D)none of the mentioned
A)semaphore
B)low level synchronization construct
C)high level synchronization construct
D)none of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
A monitor is characterized by
A)a set of programmer defined operators
B)an identifier
C)the number of variables in it
D)all of the mentioned
A)a set of programmer defined operators
B)an identifier
C)the number of variables in it
D)all of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
A procedure defined within a___________ can access only those variables declared locally within the___________and its formal parameters.
A)process, semaphore
B)process, monitor
C)semaphore, semaphore
D)monitor, monitor
A)process, semaphore
B)process, monitor
C)semaphore, semaphore
D)monitor, monitor
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
If no process is suspended, the signal operation___________
A)puts the system into a deadlock state
B)suspends some default process execution
C)nothing happens
D)the output is unpredictable
A)puts the system into a deadlock state
B)suspends some default process execution
C)nothing happens
D)the output is unpredictable
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
A collection of instructions that performs a single logical function is called
A)only one process can be active at a time within the monitor
B)n number of processes can be active at a time within the monitor (n being greater than 1)
C)the queue has only one process in it at a time
D)all of the mentioned
A)only one process can be active at a time within the monitor
B)n number of processes can be active at a time within the monitor (n being greater than 1)
C)the queue has only one process in it at a time
D)all of the mentioned
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
What are the operations that can be invoked on a condition variable?
A)wait & signal
B)hold & wait
C)signal & hold
D)continue & signal
A)wait & signal
B)hold & wait
C)signal & hold
D)continue & signal
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck