[Oberon] Volatile variables in Oberon
Douglas G. Danforth
danforth at greenwoodfarm.com
Fri Jul 29 00:41:41 CEST 2016
If by volatile you mean
"In computer programming
<https://en.wikipedia.org/wiki/Computer_programming>, particularly in
the C <https://en.wikipedia.org/wiki/C_%28programming_language%29>, C++
<https://en.wikipedia.org/wiki/C%2B%2B>, C#
<https://en.wikipedia.org/wiki/C_Sharp_%28programming_language%29>, and
Java <https://en.wikipedia.org/wiki/Java_%28programming_language%29>
programming languages
<https://en.wikipedia.org/wiki/Programming_language>, the *volatile*
keyword
<https://en.wikipedia.org/wiki/Keyword_%28computer_programming%29>
indicates that a value
<https://en.wikipedia.org/wiki/Value_%28computer_science%29> may change
between different accesses, even if it does not appear to be modified.
This keyword prevents an optimizing compiler
<https://en.wikipedia.org/wiki/Optimizing_compiler> from optimizing away
subsequent reads or writes and thus incorrectly reusing a stale value or
omitting writes. Volatile values primarily arise in hardware access
(memory-mapped I/O <https://en.wikipedia.org/wiki/Memory-mapped_I/O>),
where reading from or writing to memory is used to communicate with
peripheral devices <https://en.wikipedia.org/wiki/Peripheral_device>,
and in threading <https://en.wikipedia.org/wiki/Thread_%28computing%29>,
where a different thread may have modified a value."
Then I would say any variable, x, exported from a module m as read only,
m.x-, would be nonvolatile to modules external to m. A call to any
procedure m.p could, of course, change the value of m.x. The Oberon
language (at least to my knowledge) does not support the concept volatile.
What is the need driving your question?
-Doug Danforth
On 7/28/2016 9:27 AM, Srinivas Nayak wrote:
> Dear All,
>
> In Oberon, do we have a way to specify, if a variable is volatile?
> If not, how do we work around for such a need?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160728/f9d9542d/attachment.html>
More information about the Oberon
mailing list