[Info-vax] LLVM, volatile and async VMS I/O and system calls

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Thu Sep 23 13:51:41 EDT 2021


On 2021-09-23, chris <chris-nospam at tridac.net> wrote:
>
> So what is the issue here ?. Keywords like volatile would not normally
> ever be used at app level, being reserved for low level kernel and
> driver code where it touches real hardware registers. or perhaps
> memory locations reserved for a specific purpose.

There are a number of instances where it is quite valid (and expected)
to use a volatile attribute in normal applications, especially when
asynchronous I/O is involved.

The use of volatile is not restricted to those who know the resistor
colour code chart off by heart. :-)

For example, Linux uses it (correctly) in its own asynchronous I/O interface:

https://man7.org/linux/man-pages/man7/aio.7.html

>
> If systems and code are designed and written properly, then it should
> compile to usable code irrespective of compiler, including
> optimisation level, so long as the compiler is standards compliant.
> Anything else is s system design issue...
>

In this case, the standards compliant approach would have been to require
the volatile attribute from day 1 on those variables/fields/buffers which
are filled in _after_ the system call has returned control to the program.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list