[ Fabrizio Oddone > Preempting the Mac > * | Italian Recipes | Ricette Italiane | Y2K | Site Map | What's New ]
Last updated: February 24, 1997
Bill Karsh writes:
Read your MacTech article with interest, good job...
Your EventLoop() function contains the line:
while(gDhrystoneDone == false) ;
It seems to me that a truly savvy optimizing compiler ought to notice that, because no subroutine calls are made from the body of this loop, gDhrystoneDone is a constant, and the loop can be removed entirely. I have never seen a compiler do that for globals, but strictly speaking, I believe compilers should do the removal.
I contend that one should be required to protect against removal for threaded code by declaring gDhrystoneDone volatile. What do you think?