Re: Thank goodness I'm retired...
Yes it's annoying having to use words isn't it
7 publicly visible posts • joined 22 Feb 2012
This is a really shocking faliure.
However.
If your bus timetable / iPad / etc is really that important, why do you have no redundancy? No backup? You're relying on one carrier, one network? That's pretty silly.
Bet nobody will learn from it either. Just blame somebody else (O2) and wait for the next outage.
And then you have a new bug, because volatile does not erect a memory fence so your data access is unsynchronised. What you should really be doing is surrounding both the get and the set with MUTEXES ... and then volatile has no further effect anyway because the mutex prohibits the optimisation you were trying to avoid. Conclusion: volatile is irrelevant for multi-threading. (It still has value when you're reading from a memory location populated by some low-level piece of hardware ... say it's mapped from a PIO or something ...)