2

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?

apadana
  • 13,456
  • 15
  • 82
  • 98
  • possible duplicate of [Spinlocks, How Useful Are They?](http://stackoverflow.com/questions/1456225/spinlocks-how-useful-are-they) – xmojmr Nov 20 '14 at 14:51

1 Answers1

3

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. provides spin_mutex and spin_rw_mutex which in turn are used inside of some concurrent containers (e.g. concurrent_hash_map).

Anton
  • 6,349
  • 1
  • 25
  • 53