Operating-Systems
October 10, 2023
Digital-Logic-Design
October 10, 2023
Operating-Systems
October 10, 2023
Digital-Logic-Design
October 10, 2023

Operating-Systems

Question 408
Which of the following statements about semaphores is true?
A
P and V operations should be indivisible operations
B
A semaphore implementation should guarantee that threads do not suffer indefinite postponement
C
If several threads attempt a P(S) operation simultaneously, only one thread should be allowed to proceed.
D
All of the above
Question 408 Explanation: 
● A semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system
● Semaphores are a useful tool in the prevention of race conditions; however, their use is by no means a guarantee that a program is free from these problems.
● Semaphores which allow an arbitrary resource count are called counting semaphores, while semaphores which are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores and are used to implement locks.
Correct Answer: D
Question 408 Explanation: 
● A semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system
● Semaphores are a useful tool in the prevention of race conditions; however, their use is by no means a guarantee that a program is free from these problems.
● Semaphores which allow an arbitrary resource count are called counting semaphores, while semaphores which are restricted to the values 0 and 1 (or locked/unlocked, unavailable/available) are called binary semaphores and are used to implement locks.
1 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!