Transactional memory is an approach to concurrency that avoids many of the problems with traditional locking approaches like deadlocks and priority inversions. The TL2 algorithm implements transactional memory using software. It associates version numbers with memory locations and tracks read and write sets for transactions. Transactions validate that no other transactions have modified memory since it was read, acquire write locks, and if successful, commit writes by updating version numbers. Hardware transactional memory instead uses CPU caches and modified cache coherence protocols to detect conflicts during transactions.