Transactions and in-memory data (part 3 of n)- May 18, 2005 Last time I laid out a little framework for transactional rollback. It clearly is not sufficient for a real honest-to-goodness persistent transaction but if you can tolerate every ESE failing (due to allocating the rollback log entry) it's pretty compelling. Pretty much every function can be transactional if it only works with data structuresalgorithms which could support this metaphor. It might look something like... int do_work(collection_t collection, int x, int y, int z)...http://blogs.msdn.com/mgrier/archive/2005/05/18/419058.aspx Transactions and in-memory data (part 2 of n)- May 17, 2005 Buffering the opertations wasn't particularly successful. Let's look at maintaining a rollback log. Seems pretty simple. You can do something like: typedef void (rollback_function_ptr_t)(void context);typedef struct _rollback_record rollback_function_ptr_t rollbackFunction; struct _rollback_record next; rollback_record_t;void do_rollback(rollback_record_t head) while (head != NULL) rollback_record_t...http://blogs.msdn.com/mgrier/archive/2005/05/17/418428.aspx |