Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is blowing my mind. I had no idea this was possible on x86.


Note that locking primitives include memory fences, that's why you are not confronted with re-ordering problems unless you do lockfree multicore programming.

From my experience, the fence is much costlier than the actual locking (at least on Linux, thanks to Futexes [1]). So unless you're going to put your hands in the dirt and remove the fence, it is useless and error prone to remove the locking, just because you believe it is not necessary.

[1] http://en.wikipedia.org/wiki/Futex




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: