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

Anything can be a bad idea if it is abused and having 80 million individual overlapping reads of individual shared objects is total nonsense. That kind of synchronization on tiny bits of data would just indicate terrible design choices more than anything. Atomic reference counting can be extremely useful, simple, elegant and fast, but there is no single silver bullet to concurrency.



Having an arbitrary large number of concurrent read operations and expect no or minimal contention is completely reasonable.


That depends on the technique, the lifetime of the data and the lifetime of the memory that holds it.

If you want to make sure the data won't be touched and the memory won't be freed while you read it, reference counting can be a great technique.

If the memory allocation (including size) is already known to be stable but the data could change, the data can be read along with a time or version number that will let the reader make sure it didn't change while it was being read.

If the data can be read atomically, this isn't a problem. If the 'data' is just a pointer that is meant to transfer ownership to the reading thread this isn't a problem, etc.

The underlying principal here is that there are many different techniques and design trade-offs when it comes to concurrency and synchronization. Discounting one thing because it isn't a silver bullet is ridiculous, because there are not silver bullets. A system has to be architected as a whole.




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

Search: