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

I remember taking an excellent multicore class in college. We studied all sorts of non-blocking data structures and fancy locks with different properties, transactions, etc. Then toward the end, the professor mentioned in a rather offhand way one day something along the lines of "90% of the time you're going to get the best performance with a simple mutex".

I forgot how to implement all those fancy patterns, but I remember the sense of paranoia that class instilled in me. I guess that was the point.



Even worse, cachelines are essentially RWLocked for you by the CPU cores. It's always mutexes underneath, no matter what you do.

https://en.wikipedia.org/wiki/MESI_protocol




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

Search: