That paper just gave me the willies. I wasn't buying it, even if it was from Boehm. Then I got to the part were the optimizer did register promotion in a legit way which was clearly non-threadsafe...
Ugh. Compilers shouldn't have to care about threads. And yet apparently they must.
Interesting paper. And since one good read on multithreading deserves another, you might want to check out Herb Sutter's article "The Trouble With Locks", from the C/C++ User's Journal:
Unfortunately, it seems to be subscriber's only at this point, but even if you aren't a subscriber it's worth tracking down a copy somewhere. You'll never think about multithreading and virtual functions the same way again.
Ugh. Compilers shouldn't have to care about threads. And yet apparently they must.
Thanks for pointing the paper out
http://www.cuj.com/documents/s=9597/cuj
Unfortunately, it seems to be subscriber's only at this point, but even if you aren't a subscriber it's worth tracking down a copy somewhere. You'll never think about multithreading and virtual functions the same way again.