[Info-vax] yet another sys$qiow question

Craig A. Berry craigberry at nospam.mac.com
Fri Aug 21 12:26:04 EDT 2015


On 8/21/15 10:00 AM, Stephen Hoffman wrote:
> On 2015-08-21 14:18:09 +0000, Craig A. Berry said:
>
>> On 8/21/15 8:41 AM, Johnny Billquist wrote:
>>
>>> What is wrong with checking the IOSB before the I/O completes? There
>>> is absolutely nothing wrong with that. And if it is non-zero, it
>>> means the I/O already have completed, so there is no point in
>>> waiting, since it will return immediately.
>>
>> Until the I/O completes, the status of the IOSB is undefined. Show me
>> where there is a guarantee that if one longword of the IOSB has been
>> written, that the other longword has also been written, i.e., that the
>> entire IOSB is written atomically or in a single instruction. Without
>> that guarantee, non-zero does not mean complete.
>
> Aside from the discussion of volatile and variable modifications
> out-of-compiler-scope being discussed else-thread, polling the IOSB is a
> documented and supported approach.
>
> Quoth The Fine Manual: "The process polls the I/O status block. If the
> low-order word still contains zero, the I/O operation has not yet
> completed. In this example, the program loops until the request is
> complete."
> <http://h30266.www3.hp.com/odl/vax/opsys/vmsos73/vmsos73/5841/5841pro_062.html>

Yuck. So it is, even in the current version of that manual [1], but it
also says it's not the preferred method and recommends using SYS$SYNCH
instead. So it would also be a fair reading of the manual to say it
recommends against the polling method even though it includes an example
of it. I wish it would say "don't do that" a bit more strongly. The only
thing the discussion of volatile has added is yet another reason not to
do it that way.

[1] Recently observed at the following URL as of this writing:

http://h30266.www3.hp.com/odl/axpos/opsys/vmsos84/5841/5841pro_065.html#example_iostatusblock




More information about the Info-vax mailing list