Rhino lets multiple applications access a database concurrently. To ensure isolation among transactions, database regions must be locked until a transaction finishes. Rhino asserts locks in MMU page grain using page faults.
Before a transaction starts, MMU mappings for the database region are invalid. The first access to a page causes a page fault. The page fault handler in the Rhino extension obtains either a read or a write lock on the page, depending on whether the access is load or store. This scheme is essentially the same as that used in systems such as ObjectStore [odi] and QuickStore [white]. Other locking approaches are possible, such as requiring applications to issue a system call to lock a region [camelot]. However, we decided on the MMU-based automatic locking approach to make the programming interface as simple as possible.
A shortcoming of this approach is that multiple threads in a single process cannot execute transactions simultaneously on the same database. However, this is not a serious problem since thread is not a unit of protection in most operating systems including SPIN; protecting database accesses by threads does not provide much help to programmers.