Question: I am trying to protect a queue data structure that is shared among 45 kernel threads. Whenever a thread accesses the queue, they always either
I am trying to protect a queue data structure that is shared among 45 kernel threads. Whenever a thread accesses the queue, they always either add an item to the queue (enqueue) or remove an item from the queue (dequeue). In this scenario, would reader-writer locks be better than mutex locks?
Select all that apply.
a. RW locks are more secure than mutex locks.
b. RW locks are always faster than mutex locks.
c. RW locks are never faster than mutex locks.
d. Yes.
e. Can't tell, not enough info about the behavior of the system.
f. They would both perform about the same. RW locks might even be a tad slower.
g. No. They're all writers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
