Process - Busy waiting
-
- Member
- Posts: 59
- Joined: Tue May 23, 2006 11:00 pm
Process - Busy waiting
Is there a way to implement Busy waiting and Spin locks (mutual exclusion), without using while and for loops ?
-
- Member
- Posts: 134
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: North Dakota, where the buffalo roam
Re: Process - Busy waiting
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 ?
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia