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

Johnny Billquist bqt at softjar.se
Mon Nov 6 06:21:29 EST 2023


On 2023-11-04 20:03, Craig A. Berry wrote:
> On 11/4/23 1:42 PM, Arne Vajhøj wrote:
>> On 11/4/2023 1:06 PM, Craig A. Berry wrote:
>>>
>>> On 11/4/23 6:11 AM, Johnny Billquist wrote:
>>>
>>>> I'm not sure I have ever understood why people think memory mapped 
>>>> files would be faster than a QIO under VMS.
>>>
>>> I might've missed it but I haven't seen anyone say that. It's that
>>> global sections are faster than mailboxes. The I/O API may be a
>>> consideration but is secondary to the nature of the device.
>>
>> I guess that I as usual will have to plead guilty.
>>
>> I wrote:
>>
>> # The normal assumption regarding speed of disk IO would be that:
>> #
>> # RMS record IO ($GET and $PUT) < RMS block IO ($READ and $WRITE) <
>> # $QIO(W) < $IO_PERFORM(W) < memory mapped file
>> #
>> # (note that assumption and fact are spelled differently)
>>
> 
> 
> Actually, I'm guilty of forgetting I read that message.  I had in mind
> Jake's original problem of IPC, not disk I/O, when I responded to
> Johnny's remark about memory mapped files. For disk I/O, yes, it's
> almost certain that using virtual memory primitives to synchronize
> integral pages between disk and memory will be faster than any other I/O
> method; that's why pretty much every database product on every platform
> does it.

And that is what I am questioning. Why would memory mapped I/O to disk 
be any faster than IO_PERFORM? After all, both cases will just be DMA 
from disk to your memory without any intermediate copying.

With IO_PERFORM you need to issue the request to do a read. With memory 
mapped I/O you need to do a system call to instead first tell which part 
of the file you want mapped, and then hit a page fault to get the read 
to happen.

Why pretty much every database product on every platform use memory 
mapped I/O is most likely becase "every platform" is basically 
Unix/Linux or Windows. In which case "normal" I/O always goes through 
another layer of buffering and copying, making memory mapped I/O very 
supierior. That isn't nearly the same situation as under VMS.

   Johnny




More information about the Info-vax mailing list