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 process. 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 ?
Asked by Zephyr
(183 rep)
Oct 31, 2017, 08:27 AM
Last activity: Oct 31, 2017, 08:52 AM
Last activity: Oct 31, 2017, 08:52 AM