Dr. Dobb's Journal - December 2007 - (Page 6) d12edit_p2ma 10/18/07 8:08 AM Page 6 Hmmmm by Jonathan Erickson There Are Transactions, Then There Are Transactions EVERY NOW AND THEN, a term or technology—even an established one—sneaks up and slips by. Take “transactions,” for instance. Transactions are something we all do every day, but other than making sure the barrista forks over exact change, we don’t give much thought to them. When it comes to software, however, there are lots of different kinds of transactions: Faircom’s c-tree Server includes online transaction processing to guarantee ACID (atomicity, consistency, isolation, and durability); Microsoft’s Transaction Server is a COM-based transaction processing system; Java sports a Transaction API; and Oracle’s Berkeley DB is a transactional database engine, to mention a few. Then there’s Falcon (forge.mysql.com/wiki/Falcon), a transactional storage engine based on the Netfrastructure database engine, but extended and integrated into MySQL (and mentioned on page 20 of this issue by Jim Starkey, its designer). What’s interesting about Falcon is that it is a transactional database engine designed from the ground up with multicore processors and threading in mind. It also supports Multi-Version Concurrency Control (MVCC), another 1980-era technology for concurrent access to databases. These days, it seems that “transaction” and “concurrency” go hand-in-hand. Considering its stake in concurrency, it’s no surprise that Intel has latched on to the concept of “software transactional memory” (STM), a technology that’s been around since the early 1990s when Nir Shavit and Dan Touitou published their paper “Software Transactional Memory.” Since then, STM has found its way into any number of environments, ranging from Smalltalk, C/C++, and C#, to Python, Perl, .NET, and Java, among others. Clearly, from Intel’s perspective, STM—or anything else that supports and promotes concurrency—is a good thing. Which is why the company added STM runtime libraries and transactional language construct extensions to its C++ compiler (softwarecommunity .intel.com/articles/eng/1460.htm). According to Intel, transactional memory simplifies parallel programming by supporting “atomic” and “isolated” execution of userspecified tasks. Intel goes on to say (and I paraphrase) that parallel programming traditionally used locks to synchronize concurrent access to shared data. But lockbased synchronization has known pitfalls: Using locks for fine-grain synchronization and composing code that already uses locks are both difficult and prone to deadlock. Transactional memory provides an alternative to locks as a general-purpose concurrency control mechanism. This alternate concurrency control mechanism avoids these pitfalls, thus easing parallel programming. (Locks, synchronization, and concurrency are topics that Herb Sutter tackles on page 57 of this issue.) But transactional computing isn’t just limited to databases and compilers, as Calum Grant points out in his article “Transactional Programming” on page 46 of this issue. Calum applies database concepts to C++ programming. And, as he says, “By copying the database approach, C++ can also implement transactions. It provides guarantees of atomic behavior, it can help in complex error-recovery situations, and allows smaller functions to be composed into larger transactions.” Transactional programming isn’t limited to C++. Not only is it done with general-purpose languages, but also with special-purpose ones designed with transactions in mind. For instance, Atomos (tcc.stanford .edu/publications/tcc_pldi2006.pdf), a program language developed by Brian Carlstrom et al. at the Stanford University Computer Systems Lab, purports to be the first programming language with implicit transactions, strong atomicity, and a scalable multiprocessor implementation. According to its designers, Atomos is derived from Java, but replaces Java’s synchronization and conditional waiting constructs with simpler transactional alternatives. Consequently, Atomos simplifies the writing of parallel programs utilizing transactional memory. The Atomos virtual machine uses violation handlers to recover from expected violations without necessarily rolling back. According to its developers, the performance benefits and simplicity of coding compared to Java demonstrate the value of programming with transactions. The list could go on and on I suppose, but its time for me to head over to the coffee shop and initiate a transaction of my own. We kick off the New Year by examining web development. Next Month: Jonathan Erickson Editor-in-Chief jerickson@ddj.com 6 Dr. Dobb’s Journal l www.ddj.com l December 2007 http://forge.mysql.com/wiki/Falcon http://tcc.stanford.edu/publications/tcc_pldi2006.pdf http://tcc.stanford.edu/publications/tcc_pldi2006.pdf http://softwarecommunity.intel.com/articles/eng/1460.htm http://softwarecommunity.intel.com/articles/eng/1460.htm http://www.ddj.com
Table of Contents Feed for the Digital Edition of Dr. Dobb's Journal - December 2007 Dr. Dobb's Journal - December 2007 Contents Hmmmm Alia Vox Developer Diaries Developer’s Notebook Computer Books: Reading Between the Lines Conversations Query Anything with SQLite XQuery Web Maps with the Google Map API OpenALM and Its Manifesto Transactional Programming Effective Concurrency The Agile Edge Swaine’s Flames Dr. Dobb's Journal - December 2007 Dr. Dobb's Journal - December 2007 - Dr. Dobb's Journal - December 2007 (Page Cover1) Dr. Dobb's Journal - December 2007 - Dr. Dobb's Journal - December 2007 (Page Cover2) Dr. Dobb's Journal - December 2007 - Dr. Dobb's Journal - December 2007 (Page 1) Dr. Dobb's Journal - December 2007 - Dr. Dobb's Journal - December 2007 (Page 2) Dr. Dobb's Journal - December 2007 - Dr. Dobb's Journal - December 2007 (Page 3) Dr. Dobb's Journal - December 2007 - Contents (Page 4) Dr. Dobb's Journal - December 2007 - Contents (Page 5) Dr. Dobb's Journal - December 2007 - Hmmmm (Page 6) Dr. Dobb's Journal - December 2007 - Hmmmm (Page 7) Dr. Dobb's Journal - December 2007 - Hmmmm (Page 8) Dr. Dobb's Journal - December 2007 - Hmmmm (Page 9) Dr. Dobb's Journal - December 2007 - Alia Vox (Page 10) Dr. Dobb's Journal - December 2007 - Alia Vox (Page 11) Dr. Dobb's Journal - December 2007 - Developer Diaries (Page 12) Dr. Dobb's Journal - December 2007 - Developer Diaries (Page 13) Dr. Dobb's Journal - December 2007 - Developer’s Notebook (Page 14) Dr. Dobb's Journal - December 2007 - Developer’s Notebook (Page 15) Dr. Dobb's Journal - December 2007 - Computer Books: Reading Between the Lines (Page 16) Dr. Dobb's Journal - December 2007 - Computer Books: Reading Between the Lines (Page 17) Dr. Dobb's Journal - December 2007 - Computer Books: Reading Between the Lines (Page 18) Dr. Dobb's Journal - December 2007 - Computer Books: Reading Between the Lines (Page 19) Dr. Dobb's Journal - December 2007 - Conversations (Page 20) Dr. Dobb's Journal - December 2007 - Conversations (Page 21) Dr. Dobb's Journal - December 2007 - Conversations (Page 22) Dr. Dobb's Journal - December 2007 - Conversations (Page 23) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 24) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 25) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 26) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 27) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 28) Dr. Dobb's Journal - December 2007 - Query Anything with SQLite (Page 29) Dr. Dobb's Journal - December 2007 - XQuery (Page 30) Dr. Dobb's Journal - December 2007 - XQuery (Page 31) Dr. Dobb's Journal - December 2007 - XQuery (Page 32) Dr. Dobb's Journal - December 2007 - XQuery (Page 33) Dr. Dobb's Journal - December 2007 - XQuery (Page 34) Dr. Dobb's Journal - December 2007 - XQuery (Page 35) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 36) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 37) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 38) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 39) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 40) Dr. Dobb's Journal - December 2007 - Web Maps with the Google Map API (Page 41) Dr. Dobb's Journal - December 2007 - OpenALM and Its Manifesto (Page 42) Dr. Dobb's Journal - December 2007 - OpenALM and Its Manifesto (Page 43) Dr. Dobb's Journal - December 2007 - OpenALM and Its Manifesto (Page 44) Dr. Dobb's Journal - December 2007 - OpenALM and Its Manifesto (Page 45) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 46) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 47) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 48) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 49) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 50) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 51) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 52) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 53) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 54) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 55) Dr. Dobb's Journal - December 2007 - Transactional Programming (Page 56) Dr. Dobb's Journal - December 2007 - Effective Concurrency (Page 57) Dr. Dobb's Journal - December 2007 - Effective Concurrency (Page 58) Dr. Dobb's Journal - December 2007 - Effective Concurrency (Page 59) Dr. Dobb's Journal - December 2007 - The Agile Edge (Page 60) Dr. Dobb's Journal - December 2007 - The Agile Edge (Page 61) Dr. Dobb's Journal - December 2007 - The Agile Edge (Page 62) Dr. Dobb's Journal - December 2007 - The Agile Edge (Page 63) Dr. Dobb's Journal - December 2007 - Swaine’s Flames (Page 64) Dr. Dobb's Journal - December 2007 - Swaine’s Flames (Page Cover3) Dr. Dobb's Journal - December 2007 - Swaine’s Flames (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.