[Info-vax] yet another sys$qiow question

David Froble davef at tsoft-inc.com
Wed Aug 19 19:40:21 EDT 2015


Johnny Billquist wrote:

Some of this has caught my attention.


> Exmaple:
>   x = iosb;
>   y = iosb;


> The C compiler can easily compact this into just one read of the iosb 
> variable, even if your source code have two reads. And if the system 
> actaully changed the value between these two reads, then you could argue 
> that y got the wrong value.

If this is what you get from optimization, then I got to ask, is optimized code 
accurate?

> Even more fun:
> 
>   while (iosb == 0) ;

In this case, I'm going to observe that it's poor coding practice.  Why would 
you tie up the CPU in a loop?  Wouldn't that have an adverse affect on all users?



More information about the Info-vax mailing list