[Info-vax] QIO Writes to a mailbox
Michael Moroney
moroney at world.std.spaamtrap.com
Thu Nov 10 15:35:42 EST 2011
Johnny Billquist <bqt at softjar.se> writes:
>The RWMBX state might prove your point for mailboxes, though. I should
>test this (or someone else could).
>Does the whole process block if you try to write to a full mailbox? Even
>if you just do a QIO, and not a QIOW?
The process blocks. It's a kind of a nasty state.
>If so, then the mailbox driver is indeed moving in as a part of the QIO
>processing. But if so, then I also wonder what the VMS engineers were
>thinking. There isn't really any reason for blocking the whole process
>under such circumstances.
Mailboxes were original to VMS. The driver was written before they really
had a good grasp as to what was and wasn't a good idea on VMS. IMO.
>> Note that my experience is with QIOW with IO$M_NOW for writes to
>> mailbox, and I assume that the DCL WRITE statement does the equivalent
>> when writing to a mailbox device because they behave the same. And note
>> that a DCL WRITE to a full MAILBOX does cause the process to hang in RWMBX.
>If you do a QIOW with IO$M_NOW, then you should never get to RWMBX
>state.
Actually, you're _more_ likely to get into a RWMBX state using IO$M_NOW
than without it. Why? A program trying to write a zillion messages to a
mailbox with no (or a slow) reader not using IO$M_NOW will only be able to
get one message into a mailbox at a time (or N messages if multibuffered
with N buffers and using $QIO). Using IO$M_NOW will allow all write IOs
to complete quickly as all the messages get stashed into the mailbox's
buffer until the buffer is consumed and then the process is put into
RWMBX.
> Nor will you ever have a situation where your program can
>potentially have a buffer that is yet not copied into the mailbox, but
>soon might be. IO$M_NOW ensures that if the mailbox is full, the QIOW
>will complete the I/O with an error saying that the mailbox was full,
>and the I/O could not be completed.
You're thinking of IO$M_NORSWAIT, not IO$M_NOW. If you specify
IO$M_NORSWAIT, the program will get a SS$_MBFULL error instead of going
into RWMBX.
IO$M_NOW just means don't hang around waiting for a reader (or writer)
of your message.
More information about the Info-vax
mailing list