What are the runtime issues with thread-level protection / paging?
Ok, so we support paging / protection for every process to date. I have wondered for many years what benefit can be gained by offering page-level security, which is arguably the smallest execution unit supported by our operating systems today: threads. This question about software transactional memory brought it back to the fore for me.
Benefits of having page-level rights
- OS support for page blocking on access
- In theory, protection against memory corruption if the OS had a mechanism to take responsibility for the thread's lifetime.
Disadvantages:
- Deadlock detection with standard locking technology is already hard enough
- debugger / OS support for determining page level property
Any other disadvantages you can see from supporting such a model?
a source to share
Data protection per page on one page can be used to efficiently use concurrent garbage collection.
The problem to be solved is that in order to collect a region of memory, the garbage collector needs exclusive access to that region, otherwise other threads (called " mutator ") could read and write objects that are not in a consistent state (for example , halfway through copying from oldspace to the news section ).
With memory protection on a thread, the garbage collector can control access to a region of memory so that only the collector thread can access it; attempts by other threads to access the memory area will result in segmentation errors that can be handled by the collector (for example, blocking the thread until the collector has finished that area).
a source to share