Test and test-and-set: Difference between revisions

Content deleted Content added
Rob* (talk | contribs)
https://en.wikipedia.org/w/index.php?title=Test_and_test-and-set&oldid=869387971 seems to have misunderstood that the pseudocode in https://en.wikipedia.org/wiki/Test-and-set#Software_implementation_of_test-and-set is only pseudocode and is _missing_ "actual atomic locking". The yield() doesn't help. As such, i think previous versions of the text of this section are clearer. Really, this article should maybe just be a section in the test-and-set article.
m Caveat: Hyphen, comma, negative.
Line 29:
 
==Caveat==
Although this [[Optimization (computer science)|optimization]] is useful in [[system programming]], it should be avoided in high -level [[concurrent programming]] unless allwhen constraints are clearunclear and understoodmisunderstood. One example of bad usage is a similar [[programming idiom|idiom]] called [[double-checked locking]], which is [[Double-checked_locking#Usage_in_Java|unsafe without special precautions]] and can be an [[anti-pattern]].<ref>David Bacon et al. [http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html The "Double-Checked Locking is Broken" Declaration].</ref>
 
==See also==