I implemented a sorted linked list
as two versions. The first one is using single mutex
for the entire list and the second one uses single rwlock
for the entire list.
I ran half of the operations as Member
and the other half made of Insert(0.25)
and Delete(0.25)
operations. I plotted the time against a number of threads and in this case was not as expected that the time for rwlock
was higher than mutex
.
How can this happen? When there are more than 90% Member operations then rwlocks
were better as expected.