Hi all
LDD 3rd ed page 115 says
" Spinlocks are, by their nature, intended for use on multiprocessor systems,although a uniprocessor workstation running a preemptive kernel behaves like SMP, as far as concurrency is
concerned.If a nonpreemptive uniprocessor system ever went into a spin on a lock, it would spin forever; no other thread would ever be able to obtain the CPU to release the lock. For this reason, spinlock operations on uniprocessor systems without preemption enabled are optimized to do nothing, with the exception of the ones that change the IRQ masking status. "
I want to ask what does it mean by " if a nonpreemptive uniprocessor system ever went into a spin on a lock, it would spin forever,no other thread would ever be able to obtain the CPU to release the lock " .
Why is it so? and how ? can someone plz send me a code snippet to explain this statement ?
TIA
pradeep
--
play the game