Jump to content

Talk:Dekker's algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 84.180.248.29 (talk) at 20:16, 30 May 2006 (Should we delete the paragraph with the compiler optimization?). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

How does it work? Someone please describe teh algorithm!

See the source code in the link at the bottom of the article...

Should we delete the paragraph with the compiler optimization?

An optimizing compiler would also try to keep the three variables within registers. The algorithm would never work in this case. Therefore, a real implementation needs a compiler directive to add the semantic of "this variable can potentially be accessed by another entity" (e.g. ISO-C reserves the keyword "volatile" for this purpose). And once the variables are declared as "volatile", the compiler is not allowed to remove writes to them.

Please verify my arguments and correct the article accordingly. [ibbis@gmx.de]