[Info-vax] yet another sys$qiow question

Johnny Billquist bqt at softjar.se
Mon Aug 24 20:35:43 EDT 2015


On 2015-08-24 22:05, Chris Scheers wrote:
> Johnny Billquist wrote:
>> On 2015-08-21 20:11, Chris Scheers wrote:
>>> Johnny Billquist wrote:
>>>>
>>>> One example that I could think of, that might not be so poorly written
>>>> code, which could bite you, would be something like:
>>>>
>>>> SYS$QIO(<arguments>);
>>>> if (iosb == 0) {
>>>>   <do some stuff>
>>>>   <wait for I/O completion>
>>>>   printf("IOSB is now %x\n", iosb);
>>>> }
>>>
>>> Ignoring the volatile discussion for now (pun intended), I need to point
>>> out that this code is flawed because it does not allow for the case
>>> where the $QIO completes before execution of the "if".
>>
>> But it does. If the $QIO completes before the if, the code will just
>> continue after the if. If that is right or wrong is outside the scope
>> here... :-)
>>
>>     Johnny
>
> True.  Perhaps I was reading too much into this, as I have been burned
> by QIOs that complete quicker than expected on hardware other than where
> the original testing was done.  <sigh>

Oh, definitely. You can get burned by this, and I don't mind you 
bringing it up. But in the posted code, (which is rather truncated), we 
can't really tell if the program deals correctly with this situation or 
not. But you raise a valid concern...

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol



More information about the Info-vax mailing list