Shadow Paging with Shared Files
What if two transactions update different pages of a file?
- If they share their main memory copy of the page table, then committing one will commit the other’s updates too!
One solution: File-grained locking
Better solution: use a private copy of page table, per transaction. To commit T, within a critical section:
- get a private copy of the last committed value of the page table of each file modified by T
- update their entries for pages modified by T
- store the updated page tables on disk
- write a new master record and master pointer, thereby installing the update just for T (// end of critical section)