Assignment 2 Task 3

Assignment 2 Task 3

von Anna Reiter -
Anzahl Antworten: 1

Hello,

I have a question regarding the second assignment task 3. In the assignment sheet it says that two of the race conditions can be fixed using volatile. However, in bogus.c the only two shared variables (go, global_result) have already been declared as volatile. So I wondered if this is by mistake, or if not, I'd like to ask for a small hint on what else to look at. 

Thank you for your help!

Als Antwort auf Anna Reiter

Re: Assignment 2 Task 3

von Alois Zoitl -

Hi,

thanks for pointing that out. I'm extremely sorry but as you anticipated I left the two volatiles on accident in the exercise. During preparation of the exercise I had to add them for testing the overall behavior that's the reason I originally put them in. 

You do not need to search for additional volatiles. Instead of adding them please describe in your report the reason why they are needed.

Kind Regards,

Alois Zoitl