[Info-vax] Volatile, was: Re: yet another sys$qiow question
Simon Clubley
clubley at remove_me.eisner.decus.org-Earth.UFP
Wed Aug 19 11:50:07 EDT 2015
On 2015-08-19, VAXman- @SendSpamHere.ORG <VAXman- at SendSpamHere.ORG> wrote:
> Question: If "volatile" is necessary, shouldn't this code keep spinning its
> tail???
>
No, because you only have a function call in the loop (sys$qiow())
(and the function call additionally directly references iosb BTW).
This means that regardless of whether the compiler terminates the
caching scope for iosb at any function call or whether it only
terminates the caching scope when a function call references iosb,
your code still causes the compiler to generate code to re-read the
current contents of the iosb variable after the function call returns.
The current discussion is based around the belief C compilers terminate
the caching scope at any function call. I don't know if this is true
for all the other languages VMS supports.
Simon.
--
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
More information about the Info-vax
mailing list