Intel Haswell Transactional Synchronization eXtensions (TSX) explained

Posted on Thursday, September 20 2012 @ 13:55 CEST by Thomas De Maesschalck
Intel logo
One of the new features of Intel's upcoming Haswell architecture is Transactional Synchronization, an instruction set that enables hardware-accelerated transactional memory. This technology should increase per-core performance by letting the processor worry about the locking. In simplified words, the more cores a system has, the more threads you need to keep the cores busy but threads have to work on shared data and this require locks to ensure that the end result is correct. Unfortunately, a lot of times threads are doing nothing but waiting until another thread releases a lock, and this leads to a serious problem in multi-core performance scaling.

TSX aims to solve part of the performance scaling issue by removing the locks and letting the processor worry about consistency. The thread is executed under the assumption that other threads will not overwrite the variables that the thread is working on, and in case another thread does overwrite one of those shared variables, the whole process will be aborted and re-executed with a traditional lock.
The idea is to remove the locks and let the CPU worry about consistency. Instead of assuming that a thread should always protect the shared data from other threads, you optimistically assume that the other threads will not overwrite the variables that the thread is working on (in the critical section). If another thread overwrites one of those shared variables anyway, the whole process will be aborted by the CPU, and the transaction will be re-executed but with a traditional lock.

If the lock removing or elision is successful, all threads can work in parallel. If not, you fall back to traditional locking. So the developer can use coarse grained locking (for example locking the entire shared structure) as a "fall back" solution, while Lock Elision can give the performance that software with a well tuned fine grained locking library would get.
Software developers will reportedly be able to use the new TSX enabled library with limited code changes, and without having to worry about breaking backwards compatiblity.

Intel TSX performance gains slide

Full details at AnandTech.


About the Author

Thomas De Maesschalck

Thomas has been messing with computer since early childhood and firmly believes the Internet is the best thing since sliced bread. Enjoys playing with new tech, is fascinated by science, and passionate about financial markets. When not behind a computer, he can be found with running shoes on or lifting heavy weights in the weight room.



Loading Comments