[Info-vax] Volatile, was: Re: yet another sys$qiow question
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Wed Aug 19 12:58:02 EDT 2015
In article <mr28jf$l0g$1 at dont-email.me>, Simon Clubley <clubley at remove_me.eisner.decus.org-Earth.UFP> writes:
>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.
So, I should put the $QIO in a subroutine.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
I speak to machines with the voice of humanity.
More information about the Info-vax
mailing list