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

The thread lifetime is also scope-bound, to ensure the thread dies before any object it might be referring to does.



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.


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.




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

Search: