[Info-vax] LLVM, volatile and async VMS I/O and system calls
gah4
gah4 at u.washington.edu
Fri Sep 24 19:52:56 EDT 2021
On Wednesday, September 22, 2021 at 7:26:03 AM UTC-7, geze... at rlgsc.com wrote:
> On Wednesday, September 22, 2021 at 8:28:09 AM UTC-4, Simon Clubley wrote:
> > Jan-Erik's questions about ASTs in COBOL have reminded me about something
> > I asked a while back.
> >
> > VMS I/O and system calls are much more asynchronous than on other operating
> > systems and data can appear in buffers and variables in general can be
> > changed outside of the normal sequence points (such as at a function call
> > boundary).
> >
> > With the move to LLVM, and its different optimiser, have any examples
> > appeared in VMS code for x86-64 where volatile attributes are now required
> > on variable definitions where you would have got away with not using them
> > before (even if technically, they should have been marked as volatile anyway) ?
> >
> > Just curious if there's any places in code running on VMS x86-64 that will
> > need to cleaned up to do things in the correct way that you would have
> > got away with doing less correctly previously.
> >
> > Simon
> >
> > --
> > Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
> > Walking destinations on a map are further away than they appear.
> Simon,
>
> Since the days of RSX-11M, I have been dealing with client bugs in this area..
> The best phrasing I have seen in this area was in an IBM System/360 Principles of
> Operation manual. It may have only appeared in certain editions, as I cannot
> find the precise reference. However, it was along the lines of "the contents of a
> buffer are UNDEFINED [emphasis mine] from the initiation of the I/O operation
> until the operation has completed with the device end signal from the device."
That would apply at the hardware level.
But BSAM (and other B...) I/O operations are almost at that level.
(QSAM is different, and at a higher level.)
A BSAM I/O call (which is pretty much a subroutine call into an OS routine)
eventually does an EXCP, which then does the appropriate SIO to start the
I/O operation. The program should then (later) WAIT for it to complete,
and as with the description above, the buffer is undefined.
(That should be described in the appropriate manual for I/O macros.)
For the 360/85, and many S/370 models, cache made things more
interesting. Since I/O operations go directly to memory, when does
the cache get updated?
I do wonder, though, if QIO is closer to the OS/360 Queued access
methods, like QSAM.
Note also that BSAM allows for, and also PL/I, locate mode I/O
where the hardware reads/writes directly from the actual data
arrays, without any intermediate buffering. (That only works
for contiguous data.)
I am not sure how VMS does I/O buffering.
More information about the Info-vax
mailing list