Wednesday, April 23, 2008

TransactionKit

TransactionKit, from the developer of RegexKit, provides a thread-safe, lock-free replacement for NSDictionary/NSMutableDictionary. The design uses multi-version concurrency control—transaction numbers, essentially—to allow concurrent read and write access with better multi-threaded performance than using locks. Unlike NSDictionary, TransactionKit uses chaining, so it likely uses more memory and is not as cache-friendly. Chaining works nicely with atomic compare-and-swap operations, so it’s common in lock-free data structures, however open addressing can also be made lock-free. For example, Cliff Click implemented a very efficient closed hash table (with linear probing) in Java that outperforms ConcurrentHashMap (which uses lock striping). Note that TransactionKit is incompatible with Objective-C garbage collection, which the developer regards as flawed.

Comments RSS · Twitter

Leave a Comment