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

Bob Gezelter gezelter at rlgsc.com
Wed Sep 22 10:26:01 EDT 2021


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."

In OpenVMS speak, the above translates as: "The contents of the buffer are undefined from the issuance of the QIO system call until such time as the I/O is completed, signaled by the queueing of an AST; setting of an event flag; or the setting of the completion code in the IOSB."

Hoff and I  participated in a thread a ways back on a related topic. Out of order storing on Alpha requires an explicit flush of the pipeline to ensure that the IOSB, buffers, and other data is consistent when an AST is queued.

One violates that fundamental understanding at one's peril. (Yes, I have had clients try peeking at in-progress buffers, often with catastrophic results). There are absolutely no guarantees about the contents of a buffer while an I/O operation is queued or in process for the buffer.

- Bob Gezelter, http://www.rlgsc.com



More information about the Info-vax mailing list