[Info-vax] yet another sys$qiow question
George Cornelius
cornelius at eisner.decus.org
Mon Aug 24 17:19:21 EDT 2015
In article <mr750e$1jg$2 at Iltempo.Update.UU.SE>, Johnny Billquist <bqt at softjar.se> writes:
> On 2015-08-21 14:07, David Froble wrote:
>> Thanks for validating Craig's statement. You don't test the IOSB for
>> completion. If you're doing async I/O, then you wait for the AST or
>> whatever to tell you it's complete.
>
> Are you saying that it is a poorly written program if it do not use ASTs???
>
> My example code will wait on the event flag. And it will fail if you
> don't declare the iosb as volatile.
Well, that is what I posed to Hoff quite long ago, basically stating
that I was not truly sure why the sample code in the manuals was
correct.
But that question was answered by John Reagan, who explained that
as soon as you issue the $WAITFR the compiler has to assume, since
someone, somewhere, could have saved the IOSB address that had
been passed in the earlier call, that the IOSB might have
changed over any call to an external routine, which is what
$WAITFR is.
But $WAITFR has additional magic. It is pretty much guaranteed
to issue a memory barrier instruction, and that is the key to
the original problem I was trying deal with: when is it safe to
look in the buffer once you know the status word of the IOSB is
nonzero?
George
More information about the Info-vax
mailing list