QuickStudy: Transactional Memory
- 23 September, 2008 09:15
- Comments
With the increasing use of multicore CPUs in computers, programmers have to learn new techniques for parallel processing. One very promising approach is transactional memory.
The primary problem for programmers is that multiple programming threads that are executed simultaneously by different processors must often access the same memory or stored data. It is difficult to determine in advance which thread will write its results first. If one thread changes data in memory, that may invalidate another thread's processing.
Thus, the system needs to make sure that the correct write operations take place at the proper time, without interference, disruption or undue degradation of performance.
Definition:
Transactional memory is a programming approach for multiple CPUs designed to ensure that updates to shared memory are performed without interrupting or invalidating other code. Data changes are encapsulated in transactions and committed to memory only when safe -- that is, when it's clear that they will not interfere with other code. If two or more updates will change the same location, those transactions are rejected, no changes are made, and each transaction must try again until it succeeds.To accomplish this, transactional memory runs code as "atomic blocks" inside a transaction, and all memory reads and writes are isolated until they are determined to be safe. Atomic here means that the code runs without interruption. When an atomic block completes, the system rechecks memory and looks for conflicts. Finding none, it executes the write operations, and these results become visible to the entire system.
If the system detects conflicts, however, it discards the transaction log and re-executes the block. When the contending threads are re-executed, they may proceed in a different order, thereby solving the conflict. While not exactly elegant, this solution seems to work well enough.
If an exception or error is somehow not handled inside the atomic block, all updates that block would make are automatically tossed away.
Where to find transactional memory systems
Sun Microsystems's forthcoming Rock family of multithreading, multicore Sparc microprocessors, expected to debut in 2009, will include hardware support for transactional memory. A programming approach Sun calls "hybrid transactional programming" will take advantage of the new hardware when available while hiding its limitations. For details about this, see "Hybrid Transactional Memory," by Peter Damron, Alexandra Fedorova, Yossi Lev, Victor Luchangco, Mark Moir and Daniel Nussbaum at research.sun.com.
And Microsoft Research is doing significant work on transactional memory, including adding support for existing languages such as C# and new languages such as Haskell and Atomos. For more information, see research.microsoft.com.
- Bookmark this page
- Share this article
- Got more on this story? Email Computerworld
- Follow Computerworld on twitter
- 13 Essential Steps to Integrating Control Frameworks
- Selecting an Application Lifecycle Management Vendor: An Ovum Report
- FIBRE CHANNEL SOLUTIONS GUIDE - state of the fibre channel industry
- Enterprise Buyers Guide for Application Development Software
- A Technical Overview of the Oracle Exadata Database Machine and Exadata Storage Server
- iPhone 5 rumour rollup for the week ending February 10
- 3D mapping revives underwater city
- Academic challenges Turnbull over NBN satellite criticism
- What are you saying: Telstra’s customer service slowly improving, SA minister urging Facebook to overturn its photo ban
- In pictures: Capgemini opens new Canberra office
-
Windows Event Viewer phishing scam remains active
-
NeuroSky MindWave: Fun with Brainwaves
-
20 popular Ubuntu Linux apps you may want to try
-
Nokia N9: Why you shouldn't buy this device
-
Microsoft at a loss over Event Viewer scam
-
Office 2007 All-In-One Desk Reference for Dummies
-
Teach Yourself Visually Windows 7
-
Office 2007 for Dummies
-
Windows 7 for Seniors for Dummies®
-
MYOB Software for Dummies 6E Australian Edition
-
Excel 2007 All-In-One Desk Reference for Dummies
-
Windows 7 for Dummies® Dvd+book Bundle
-
Computers for Seniors for Dummies, 2nd Edition
-
Microsoft Office












Comments
Post new comment