Content deleted Content added
added alternative implementation |
m spelling |
||
Line 3:
To lower the overhead a more elaborate locking protocol ''Test and Test-and-set''
is used. The main idea is '''not''' to spin in [[test-and-set]] but increase the likelihood of
''boolean'' locked := false ''// shared lock variable''
Line 17:
}
The entry protocol uses normal memory reads to [[spin]] and wait for the lock to
If the [[programming language]] used supports [[Lazy evaluation#Minimal evaluation|minimal evaluation]], the entry protocol could be implemented as:
Line 28:
==Caveat==
Although this [[optimization]] is
|