[Info-vax] yet another sys$qiow question
Johnny Billquist
bqt at softjar.se
Fri Aug 21 13:44:12 EDT 2015
On 2015-08-21 18:26, Craig A. Berry wrote:
> 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
Of course polling I/O is not in general a good idea. But to do a check
if the I/O has completed by checking the IOSB is very valid. And better
than checking the status of the event flag (cheaper). But I hope noone
does a spinning polling of the IOSB. That would just be horrible.
But in case you want to be doing other work, and do not want to use
ASTs, then you will have some kind of loop in your work, where you
occasionally will check if the I/O has completed. And then checking the
IOSB actually do make sense.
But don't worry about me. I write all my stuff in MACRO-11, and spread
ASTs all over the place... :-)
Johnny
More information about the Info-vax
mailing list