Question: 4 . 8 . But some existing optimizing compilers ( including gcc , which tends to be relatively conservative ) will optimize count _ positives

4.8. But some existing optimizing compilers (including gcc, which tends to be relatively conservative) will optimize count_positives to something similar to
The code reads as follows:
Line 1: void count underscore positives open parenthesis list 1 close parenthesis at indentation level 0.
Line 2: open curly bracket at indentation level 0.
Line 3: list p semi colon at indentation level 1.
Line 4: register int r semi colon at indentation level 1.
Line 5: r equals global underscore positives semi colon at indentation level 1.
Line 6: for open parenthesis p equals 1 semi colon p semi colon p equals p arrow operator next close parenthesis at indentation level 1.
Line 7: if open parenthesis p arrow operator val greaterthan 0.0 close parenthesis pre increment r semi colon at indentation level 2.
Line 8: global underscore positives equals r semi colon at indentation level 1.
Line 9: close curly bracket at indentation level 0.
What problem or potential problem occurs with this compiled version of the program if threads A and B are executed concurrently?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!