I have a query regarding the fact that how Spinlocks are advantageous in terms of context switching ?
Ask yourself why you use a context switch in a lock operation in the first place. What are the benefits and the disadvantages?
Now ask yourself if there are situations where the benefits are slim. How does a spin lock minimise the disadvantages of a normal lock operation?
Consider the cases where a lock is released after a minute, second, millisecond, microsecond or nanosecond.