Re: How to halt a running program without losing data?
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Tue, 27 Dec 2005 10:02:31 -0800
Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx> wrote:
> As far as changing variables in some external way, that is usually
> something only done when the code is run under control of a
> debugger....
or any of several other situations, such as memory-mapped I/O devices,
shared memory, and others. The fact that there are other situations
where it come up is the reason that....
> Or the variables you
> used to define the operations are optimized away entirely and are
> not available even in memory or register locations.
Note that this is exactly the kind of thing that the VOLATILE attribute
in f2003 addresses. VOLATILE is a bit of a strange beast in that it is
in the standard, yet there isn't actually any way to do anything
"useful" with it without stepping outside of the scope of the standard.
Basically, it tells the compiler that things outside the scope of the
standard might change (or depend on) the variable in question, and the
compiler should treat it appropriately. It has also been referred to
with terminology like "pessimization" (the opposite of optimization).
Some compilers have had VOLATILE for quite a while. This is a case of
the standard adopting an existing practice (not a universal one, but a
common one).
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- References:
- Re: How to halt a running program without losing data?
- From: Ron Shepard
- Re: How to halt a running program without losing data?
- Prev by Date: Re: How to halt a running program without losing data?
- Next by Date: Re: high-precision type
- Previous by thread: Re: How to halt a running program without losing data?
- Next by thread: Re: How to halt a running program without losing data?
- Index(es):
Relevant Pages
|