We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Technology

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What Is Transactional Memory?

By Jean Marie Asta
Updated: Jan 27, 2024
Views: 5,910
Share

In software, the scheme of transactional memory is a course of action for multithreaded programming which uses transactions that are much like those that a database uses. When two or more threads attempt to access the same data at the same time, many different undesirable situations can result in cases where a program’s outcome depends on the thread access order. Usually, one order is desired and in multithreading, locks are the predominant and simplest way to ensure that only a single thread has access to a specific resource at a time.

This approach to transactional memory contains multiple problems in regards to locks in multithreading. A lock may become permanent if some kind of unanticipated error occurs, and locks can bring about unpredictable issues with concurrency, like deadlock or priority inversion. As a result of locks being very fine-grained, another issue includes the code eventually ending up spending a majority of time between locking, context switching, and unlocking. This is a crucial problem because it can result in the code spending more time on these actions than on doing other, important work in the program. In contrast, coarse-grained locks can cause decreased processing performance and decreased concurrency.

The problems in transactional memory are addressed by advanced locks, including “lock block” from C#, read-write locks, write barriers, etc. One of the main priorities in regards to transactional memory is to have no locks and no unnecessary lock processing time. It is usually agreed that a data structure that is shared is free of locks if mutual exclusion is not required by its operations. Data structures that are shared and free of locks avoid commonly associated problems with standard locking techniques if they are in systems that are highly concurrent.

The Transactional Memory Coherence and Consistency (TCC) model is a new, proposed model on shared memory. According to the model, atomic transactions are invariably basic units of the following: parallel work, memory coherence, communication, and consistency of memory reference. The TCC model also makes parallel software simpler by eliminating synchronization that uses standards locks or semaphores. Through hardware, TCC also combines every write from each region of transaction occurrence into one packet to atomically broadcast the packet to a memory state that is permanently shared. In addition to simplified coherence hardware, this means there is a reduction in low-dormancy messages needed and a complete elimination of certain, standard coherence protocols.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Editors' Picks

Discussion Comments
Share
https://www.wise-geek.com/what-is-transactional-memory.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.