Tuesday, March 18, 2014

C11 and GCC 4.9.0

It seems that GCC 4.9.0 will finally support C11 atomics:
http://www.phoronix.com/scan.php?page=news_item&px=MTUwNTA

Can't wait for it to come out, which should be next month:
http://gcc.gnu.org/ml/gcc/2014-03/msg00190.html

Why is it about time? Well... remember that afternoon you lost due to Java's Unsafe because you used compareAndSwapObject() on an int variable, and the compiler didn't complain about it and there was no crash, but "strange things" would happen ?
No, of course you don't remember that because it didn't happen to you, but it did happen to me, and it was pretty annoying.
Yes, it was my fault, but you have to admit that Unsafe does have its "peculiarities" that can sometimes make it a pain in the neck, so I want to take the C11 atomics "out for a spin" and see how well they work.

No comments:

Post a Comment