[Info-vax] QIO Writes to a mailbox

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Wed Nov 9 08:34:45 EST 2011


In article <j9dpir$vs2$1 at dont-email.me>, Albrecht Schlosser <vms-news at go4more.de> writes:
>On 08.11.2011 22:36, VAXman- @SendSpamHere.ORG wrote:
>> In article<j9c6ug$r1s$1 at news.albasani.net>, Jan-Erik Soderholm<jan-erik.soderholm at telia.com>  writes:
>....
>>> One efficient way to do it is to check the previous IO (say, by
>>> checking the IOSB) right *before* you will do the *next* $QIO.
>>> In that way, you can do any other processing you like in your
>>> app while the I/O subsystem completes the IO asyncronicaly.
>>>
>>> Always waiting right *after* the $QIO is inefficent and you could
>>> anyway use $QIOW and let the system take care of the "waiting".
>>
>> Even when using $QIO and an AST, one needs to check the IOSB.  Like I said,
>> specify the IOSB, check it and assume nothing!
>
>Yep, that's true, of course, but may not be sufficient in
>Steve(the OP)'s case. He did not write anything about how
>often mailbox writes are generated (maybe asynchronously)
>in the writer program.
>
>If we assume that he reuses buffers (as well as the IOSB),
>then it might be possible to overwrite one message with the
>next message, so that two consecutive QIO's will send the
>same message to the mailbox. I know, this has already been
>said, but it should be considered as a possible cause of
>errors too. Thus, the reader process might read one message
>twice, and - depending on the processing in the reader
>process - may not realize the duplicate, and also miss the
>overwritten message. This *could* explain what Steve is
>seeing, even if all I/O's were working correctly (QIO and
>IOSB success).
>
>Jan-Erik's idea to check the previous IOSB value just
>before the next I/O might help, if the code also makes
>sure that the I/O buffers are written *after* the check.

Didn't I say: "specify the IOSB, check it and assume nothing!"?  Ignoring
the IOSB may just be the "tip of the iceberg" but it's a starting point.



>Of course, it would be better not to overwrite I/O buffers
>and to use different IOSB's as long as it is possible to
>do asynchronous writes to the mailbox in the first place.
>
>I'd check this possible overwriting as well as the IOSB
>return value, especially if all messages are of the same
>sizes (so that overwriting the buffer contents wouldn't
>be so obvious).

If I had a dime for each time I've fixed $QIO programming errors of this
nature I'd retire to my own island.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

All your spirit rack abuses, come to haunt you back by day.
All your Byzantine excuses, given time, given you away.



More information about the Info-vax mailing list