Newsgroups: | comp.compilers |
From: | dmk@dmk.com (David Keaton) |
Keywords: | C++, optimize |
Organization: | David M. Keaton, Boulder, CO, USA |
References: | 95-07-068 95-07-113 |
Date: | Fri, 21 Jul 1995 02:25:32 GMT |
hbaker@netcom.com (Henry Baker) writes:
>Thus, if you were computing f(g(x),h(x)), the compiler is currently free
>to _interlace_ the steps of computing g(x) with those of h(x) in any arbitrary
>order, which will cause great mischief if g(x) and h(x) are accessing some
>shared resource.
Actually, this isn't the case. According to the current C++
Working Paper, subclause 1.8 [intro.execution], paragraph 8, "Once the
execution of a function begins, no expressions from the calling
function are evaluated until execution of the called function is
completed.[footnote 6]"
Therefore, once g(x) is called, h(x) cannot be called until g(x)
finishes, and vice versa. Now, the above wording does contain a race
condition in the case that g(x) and h(x) start simultaneously.
However, footnote 6 makes the intention of the draft clear: "In other
words, function executions do not interleave with each other."
Because of this, anyone who writes a compiler that interleaves
function executions will not be able to claim conformance when the
clarified final draft of the C++ standard comes out.
Speaking of the C++ Working Paper, it is out for public review.
It can be found at the following locations.
ftp://research.att.com/dist/stdc++/WP
http://www.cygnus.com/~mrs/wp-draft/
http://maths.warwick.ac.uk/c++/
ftp://maths.warwick.ac.uk/pub/c++/std/wp/
ftp://ftp.su.edu.au/pub/C++/CommitteeDraft/
ftp://ftp.mch.sni.de/pub/documents/c++/
http://www.dcs.hull.ac.uk/cw/C++.wp-draft/index.html
http://www.ph.tn.tudelft.nl/People/klamer/wp/index.html
Now is your chance to get your comments to the committee.
David Keaton
dmk@dmk.com
http://www.dmk.com/~dmk
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.