3 ms·
So the non-owning references are kind of like weak reference but not implemented with Rc? I guess I now understand its purpose. Wondering how does this deal wi
by pca006132 4y ago
So the non-owning references are kind of like weak reference but not implemented with Rc? I guess I now understand its purpose.
Wondering how does this deal with multithread though. For example, the object A might be dropped in thread 1 (increments the generation number in thread 1) and accessed in thread 2 (reads the generation number). How do they guarantee an error in this case without using atomics? (although this might not be a valid question because you can't really say A is dropped before thread 2 accessing A without some sort of synchronization...)