[comp.os.vms] disk xqp code example -- request

carl@CITHEX.CALTECH.EDU (Carl J Lydick) (07/19/87)

 > I would like to write some data to disk without the overhead of RMS.   I've
 > tried  to  use IO$WRITEVBLK as described in the I/O manual, but despite the
 > $QIOW returning success, I find that no data has made it.   I  $CREATE  the
 > file  with  RMS,  save  the  FID for the subsequent I/O calls, etc.  I also
 > extend the file before I access it.  The extend works fine.

Sounds like you're making the mistake (common for neophytes) of assuming  that
the value returned by SYS$QIOW tells you whether the I/O request did anything.
The status returned by SYS$QIOW tells  you  whether  the  request  was  QUEUED
successfully  (that's  what  QIO stands for:  Queue I/O request).  To find out
whether the I/O request succeeded, you need to look at the value  returned  in
IOSB,  and I suspect that if you do so, the reason for the failure will become
obvious to you.

LEICHTER-JERRY@YALE.ARPA (07/21/87)

    I would like to write some data to disk without the overhead of RMS.  I've
    tried to use IO$_WRITEVBLK as described in the I/O manual, but despite
    the $QIOW returning success, I find that no data has made it.  I $CREATE
    the file with RMS, save the FID for the subsequent I/O calls, etc.  I also
    extend the file before I access it.  The extend works fine.

As someone has already pointed, be sure to check the status in the IOSB, not
just the status returned by the QIO.

HOWEVER, it's worth pointing out a fundamental incorrect assumption behind
what you are trying to do.  You are unlikely to notice any significant gain
from completely avoiding RMS.  Rather than going through all this effort,
try using RMS in block mode (using $READ and $WRITE).  These calls provide
only a very thin veneer over the QIO level, and have almost no overhead.
They are a lot easier to use than the disk QIO's.  There are probably some
very special cases where direct QIO-level access to the disk is justified,
but I'd certainly try RMS block I/O first.  (In fact, in many circumstances
using RMS in non-block mode will produce BETTER performance than simple-minded
low-level code, mainly because of RMS's built-in multi-block buffering.  Yes,
you can duplicate all that sort of stuff, but often people just assume that
because they are moving to lower levels of the I/O system, they'll get better
performance.  They CAN get better performance - IF they put in the necessary
work.  Big if!)
							-- Jerry
-------