Question: Imagine you are writing the code to manage a hash table that will be shared among several concurrent threads. Assume that operations on the table
Imagine you are writing the code to manage a hash table that will be shared among several concurrent threads. Assume that operations on the table need to be atomic. You could use a single mutual exclusion lock to protect the entire table, or you could devise a scheme with one lock per hash-table bucket. Which approach is likely to work better, under what circumstances? Why?
Step by Step Solution
3.26 Rating (161 Votes )
There are 3 Steps involved in it
A single lock is easy to code and will work quite well so ... View full answer
Get step-by-step solutions from verified subject matter experts
