I have a concurrent linked list. I need to prioritize finds on this list, so if a thread begins iterating over the list and subsequent insert/delete requests show up I’d want to queue those but if there are find requests from other threads I’d let those happen. What’s the best way to implement this situation?
EDIT: I don’t want to make copies of the list. Too expensive. Mom pays for my hardware.
Sounds like you are looking for a readers-/writer-lock. This is a lock that can be used to let many threads read the data-structure, but when one thread has write-access, all others are locked out.
Boost offers an implementation.