[ Fabrizio Oddone > Preempting the Mac > * | Italian Recipes | Ricette Italiane | Y2K | Site Map | What's New ]

Feedback on my MacTech article

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?

Good point!

This page was last built with Frontier on a Macintosh on Mon, Apr 22, 2002 at 9:41:43 PM by
Fabrizio Oddone, fab@kagi.com