Why no context switch is required in case of spinlock in operating systems?
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.