Hacker News new | past | comments | ask | show | jobs | submit login

> If enough readers are mutating the same ref counter

Well if they were mutating the ref counter I’d call them writers not readers. =P

But yes. Many people incorrectly assume that writing an atomic_int from many threads is super fast. I mean it’s atomic! It couldn’t be a smaller atom of work! Alas this is incredibly incorrect. Even atomic ints can be extremely slow.






They are logically readers, the mutation is an implementation detail.

Which relates to a fundamental principle of concurrent programming: “(logical) readers shouldn’t (physically) write*”.

*to contended shared memory


Well yes, hence the fix.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: