Reputation: 14620
A software dev peer mentioned that spin locks are mostly used at OS low level operations, like drivers. Is that true?
What are some real life good use cases of spin locks?
Upvotes: 2
Views: 111
Reputation: 6537
Though, the question might look like a duplicate or opinion-based. It contains one particular question:
Are spin locks used only at low level os operations?
No, spin-locks are generally useful on application level as well. E.g. tbb provides spin_mutex
and spin_rw_mutex
which in turn are used inside of some concurrent containers (e.g. concurrent_hash_map
).
Upvotes: 3