Site Archive (Complete)
DrDobbs Portal Blog: Software Transactional Memory and Other Transactional Events
EDITOR'S EYE

The World of Software Development.

by Jon Erickson
September 17, 2007

Software Transactional Memory and Other Transactional Events

If you aren't currrently familiar with the concept of "software transactional memory," there's every likelihood that you will be soon. Especially if multi-core development is in your future, which, if you're a software developer, it most certainly is. According to Wikipedia, software transactional memory is a "concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing."

Software transactional memory (STM) isn't necessarily a new idea. It's been kicking around since the late 1980s and early 1990s when Nir Shavit and Dan Touitou published their paper Software Transactional Memory which is credited as the first discussion of transactional memory in *software*. Since then, STM has found its way into any number of environments, ranging from Smalltalk, C/C++, C#, Python, Perl, .NET, and Java, to mention a few.

According to Intel, parallel programming has traditionally been considered using locks to synchronize concurrent access to shared data. Lock-based synchronization, however, 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 is proposed to simplify parallel programming by supporting "atomic" and "isolated" execution of user-specified tasks. In short, it is an alternative to locks as a general-purpose concurrency control mechanism. That said, there have been hardware-based proposals to generate higher performance but in a limited scope. Software approaches to STM appear to be more flexible and offer more functionality, although even Intel admits that there are a lot of unanswered questions about using TM in real-world applications.

Nevertheless, Intel has announced availability of a prototype C/C++ compiler for Windows and Linux that implements software transactional memory via a set of extensions. The STM compiler is freely available to current Intel compiler customers and free trial versions available to everyone else.

I should also mention that in our December 2007 issue, Dr. Dobb's Journal will be presenting a related article entitled "Transactional Programming" in which Calum Grant applies transactional database techniques applied to C++ development. It's really interesting.

Posted by Jon Erickson at 02:07 PM  Permalink





January 2008
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    


BLOGROLL
 

♦ sponsored
INFO-LINK


Related Sites: DotNetJunkies, SD Expo, SqlJunkies