4 ms·
What if the writer frees the memory entirely? Can you segv the reader? That would be quite a dangerous pattern.
by haberman 4y ago
What if the writer frees the memory entirely? Can you segv the reader? That would be quite a dangerous pattern.
- BeeOnRope 4y agoNo, because "freeing" memory makes sense within a single process and really means "removing the V->P mapping for the page", or more accurately something like "telling the malloc() implementation this pointer (implying a range of virtual memory) is free, which may or may not end up unmapping the V range from the process (or doing things like M_ADV_DONTNEED))". None of those would impact the same physical page mapped into another process with its own V->P mapping.