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

No, you are right. One solution is that the readers access the buffer through a shared_ptr and can hold onto the old version for as long as they need it while the writer makes changes and creates a wholly new data structure. It is also possible for the writer to block new readers while doing the swap. Tradeoffs everywhere, depending on if you need readers to see changes that occurred after they started accessing the data.



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

Search: