Process - Busy waiting
Posted: Fri Jun 16, 2006 1:13 am
Is there a way to implement Busy waiting and Spin locks (mutual exclusion), without using while and for loops ?
The Place to Start for Operating System Developers
http://f.osdev.org/
Well, by definition a spinlock just loops until something changes, so I don't really see the difference between using a real C loop and anything else, but if you're really into making code that looks weird, you could use if()...goto. If your point is that you want the processor to be doing something useful while waiting for the lock to be available, you want a different type of lock.extremecoder wrote:Is there a way to implement Busy waiting and Spin locks (mutual exclusion), without using while and for loops ?