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

Shared mutated memory isn't necessarily a problem, because it still is unknown how often access is required to that memory.

E.g. having a thread that spends perhaps 1% of the time with state mutation vs 10 threads spending each 3% of the time with state mutation. You have smaller efficiency per thread, but still higher efficiency overal



This reminds me of the whitepaper Scalability! But at what cost?

http://www.frankmcsherry.org/assets/COST.pdf

Which I think is about how single threaded programs are faster than scalable but slow multithreaded systems.

I think you might be right and that's why there is ReadWriteLock or RwLock for single writer taking turns.

If you have a counter or a data structure you're mutating in every request then you'll hit lock contention.




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

Search: