News for hackers. Stuff that matters.
Re:Never trust a programmer who says he knows C++ by gridspy on Monday March 29, 2010 @10:47PM (#1228210)
And a good programmer will raise his eyebrow at you and coolly reply "a little less optimisation"
Re:Never trust a programmer who says he knows C++ by jmtulloss on Tuesday March 30, 2010 @02:45AM (#1228565)
I'm a C programmer, not a C++ one, but at least in C, you sometimes need volatile to have a correct program.
Re:Never trust a programmer who says he knows C++ by gridspy on Tuesday March 30, 2010 @03:59PM (#1229996)
Indeed.

The underling effect of volatile is that the compiler turns off certain optimisations to do with instruction reordering and aggressive caching in registers without stores.

However in most places that a typical non-firmware, non-driver programmer would use volatile they really should be using a memory fence (acquire, release or atomic store).