[Info-vax] OpenVMS async I/O, fast vs. slow

Jake Hamby (Solid State Jake) jake.hamby at gmail.com
Tue Nov 7 12:27:57 EST 2023


On Sunday, November 5, 2023 at 6:07:52 PM UTC-8, Arne Vajhøj wrote:
> > App servers like Node.js either have only a 
> > single event loop, or one per core, so VMS's limit of 48 (64 - 8 
> > reserved) should be more than adequate.
> First I am not sure how you get 64 - 8 to be 48. My calculator 
> claims 56. 
> 
> :-) 

I'm not sure how I got that, either! The reserved event flags are 24-31. Somehow I rounded 8 up to 16. When you call lib$get_ef(), the event flags are reserved from 63 downwards. That's probably a good way to flush out any obvious bugs related to bit shifting and the flags being split into two 32-bit clusters. You can only wait on a set of event flags in one or the other cluster, not both. The design I have in mind for libuv would have an event flag per event loop. 56 should be more than enough, and each event loop would only be waiting on a single flag (its own).

I made a bigger mistake in my earlier post, which I'm surprised no one seems to have caught. I wrongly stated that the RMS file block services allowed you to read/write starting from any position, but in fact you have to read/write starting from a 512-byte block boundary, the same as for $QIO and $IO_PERFORM. You can read less than a full block, so that's how the ends of files are handled (it's not like CP/M where everything gets rounded up and you lose the real file size or anything like that).

With that additional info, I now believe the C RTL is going through RMS primarily in order to handle all the different VMS record formats it has to support, and not because it offers support for a file seek position or R/W from arbitrary file offsets, because it doesn't support either. The same for the other VMS high-level languages. So for a high-performance async I/O implementation, like a libuv port, it'd make the most sense to open files in "UFO" mode and then call $IO_PERFORM and $QIO exclusively. That's especially true since sockets, pipes (mailboxes), and ttys (pseudoterminal or serial port) will have to work that way.

Regards,
Jake Hamby



More information about the Info-vax mailing list