{"id":1712,"date":"2008-04-23T13:32:38","date_gmt":"2008-04-23T17:32:38","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=1712"},"modified":"2008-04-23T13:35:25","modified_gmt":"2008-04-23T17:35:25","slug":"transactionkit","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2008\/04\/23\/transactionkit\/","title":{"rendered":"TransactionKit"},"content":{"rendered":"<p><a href=\"http:\/\/transactionkit.sourceforge.net\">TransactionKit<\/a>, from the developer of <a href=\"http:\/\/mjtsai.com\/blog\/2007\/09\/10\/regexkit\/\">RegexKit<\/a>, provides a thread-safe, lock-free replacement for NSDictionary\/NSMutableDictionary. The <a href=\"http:\/\/transactionkit.sourceforge.net\/Documentation\/index.html\">design<\/a> uses <a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiversion_concurrency_control\">multi-version concurrency control<\/a>&mdash;transaction numbers, essentially&mdash;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&rsquo;s common in lock-free data structures, however open addressing can also be made lock-free. For example, <a href=\"http:\/\/mjtsai.com\/blog\/2007\/05\/30\/a-lock-free-hash-table\/\">Cliff Click<\/a> implemented a very efficient closed hash table (with linear probing) in Java that outperforms ConcurrentHashMap (which uses lock striping). Note that TransactionKit is <a href=\"http:\/\/www.cocoabuilder.com\/archive\/message\/cocoa\/2008\/4\/23\/204933\">incompatible with Objective-C garbage collection<\/a>, which the developer regards as <a href=\"http:\/\/www.cocoabuilder.com\/archive\/message\/cocoa\/2008\/2\/4\/197889\">flawed<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>TransactionKit, from the developer of RegexKit, provides a thread-safe, lock-free replacement for NSDictionary\/NSMutableDictionary. The design uses multi-version concurrency control&mdash;transaction numbers, essentially&mdash;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1712","post","type-post","status-publish","format-standard","hentry","category-programming-category"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1712","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=1712"}],"version-history":[{"count":0,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/1712\/revisions"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=1712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=1712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=1712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}