Next: , Previous: Objects, Up: Kernel



6.3 Transactions and topological sorting

The VRR kernel provides an interface for exception handling: transactions. To minimize the number of return value checks, we have implemented an exception handling mechanism which takes care of memory deallocation and undoing of data structure changes using the transaction logs.

All changes to kernel data structures must be done via transactions. The transaction logs are called undo histories. In every page, there is one undo history for transactions manipulating the contents of the page. Additionally, for transactions manipulating the non-graphic objects, there is one undo history stored in the page tlo_universe.

The transactions can be nested arbitrarily. If the current transaction fails, all the necessary kernel recoveries are performed automatically using the transaction log. Some other actions can be done in the exception handler code of the transaction. The exception handler may cause another transaction fail and thus cause the exception to be propagated up in the transaction stack.