News for hackers. Stuff that matters.
Re:An Introduction to Lock-Free Programming (2012) by Patient0 on Monday February 17, 2014 @01:03PM (#7253357)
Oh man, now that lock free programming is such a hot topic I am dreading the code about to be written by people "teaching themselves" about it!

"This algorithm is much faster now that I've used some lock free programming techniques I just read about!!!"

Code that works correctly on x86 but fails intermittently on another processor. It's like a nightmare unfolding...

Re:An Introduction to Lock-Free Programming (2012) by kabdib on Monday February 17, 2014 @01:52PM (#7253682)
Code that works correctly on that particular programmer's x86 machine, you mean. "Works great on my PC at home and at work" does not necessary imply "Works great on the 64 CPU production machine in the datacenter".

This stuff is terrifying.

Re:An Introduction to Lock-Free Programming (2012) by preshing on Monday February 17, 2014 @02:42PM (#7254007)
All the more reason to do our best to organize and share correct information about it.
Re:An Introduction to Lock-Free Programming (2012) by Patient0 on Monday February 17, 2014 @03:41PM (#7254366)
Yes and at least the article makes it pretty clear just how complicated and subtle the issues are.
Re:An Introduction to Lock-Free Programming (2012) by brooksbp on Monday February 17, 2014 @11:47PM (#7256434)
Shouldn't atomics behave similarly across all platforms? I am thinking of the GCC builtin atomics [1].

What sort of code are you thinking about? Even lower-level / non-abstracted atomics and memory fences that are specific to a particular architecture? I actually did run into code like this for a MIPS-based CPU and we converted the code to using the GCC builtins for portability. Funny thing is that the next hardware architecture toolchain wasn't GCC-based, so there was no benefit... we had to make wrappers for the atomics... and hunt down some absurd bugs related to L2 cache writebacks and mem fences. It was an exercise in how long I could stick with a problem... some serious hunting and staring at debug output / hex dumps..

[1] http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins....