Hacker News new | ask | show | jobs
by mihaigalos 1413 days ago
Sorry, I meant how to guard against race conditions where multiple threads try to write to the same shared memory?

This is clasically done via memory synchronization mechanisms/atomics.

1 comments

I don't understand how this has anything to do with lifetime management, which is what GC/RC/ARC are for.

You do need to synchronize concurrent access to the same object, and it's not just concurrent writes, it's concurrent accesses if at least one of them is a write.