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

The significant cost comes from contending on memory. Changing the synchronization primitive doesn't help much. You have to change your algorithm not to contend.

This is significant because if you profile your code and find that a mutex is expensive, you should change your algorithm to avoid contention rather than blindly trying to change the code to use atomics instead of mutexes.



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

Search: