I read that in spinlock, process keeps on waiting for the lock continuously in a loop until it receives signal(lock)
or release(lock)
from other processes. This causes busy waiting and hence CPU cycles are wasted.
My doubt is, if CPU is continuously checking the value of lock variable in loop, then how will some other process completely execute critical section and release the lock as executing critical section also needs CPU and CPU is busy checking the value of lock in other process?