Comparative Performance Analysis of Nested and Non-Nested Transactional Variables in Software Transactional Memory

Abstract

In concurrent programming, Software Transactional Memory (STM) provides an efficient mechanism formanaging shared memory in parallel computations, avoiding common issues like locks and deadlocks. Acrucial aspect of STM systems is the implementation of transactional variables (TVars), whichsignificantly influence concurrency levels, execution time, and memory overhead. Two primaryimplementations of TVars—nested and non-nested—present distinct advantages and trade-offs. This studyevaluates and compares the effects of nested and non-nested TVar implementations on STM performance,focusing on concurrency, execution time, rollback complexity, and memory overhead. Using the Haskellprogramming language with STM libraries under GHC version 8.6.5, both implementations weredeveloped and tested on a system with an Intel Core i5-1035G1 CPU @ 1.20 GHz, 8 GB DDR4 RAM, anda 512 GB Intel 660p NVMe SSD running Windows 11 Pro. Each configuration executed multiple depositand withdrawal operations over ten iterations: the non-nested version processed approximately 20 STMoperations in a total time of 2.0 seconds, while the nested version performed about 50 operations in 4.0seconds due to additional nested balance adjustments. Execution time and memory usage were measuredusing Haskell’s runtime and heap profiling tools (+RTS -p -hy). The results demonstrate that nested TVarsimprove concurrency by localizing conflicts within sub-transactions, achieving an average operationalthroughput approximately 25% higher than the non-nested version (0.08 seconds per operation for nestedvs. 0.10 seconds for non-nested) and consuming about 38% less total heap memory (38,792 bytes vs.63,080 bytes). Non-nested TVars provide simpler implementation with slightly faster individual executionbut less effective conflict resolution under high load. These insights can guide developers in optimizingSTM-based systems by selecting appropriate TVar models based on the concurrency demands andcomplexity of their applications.

Author Biography

Meenu Meenu, Madan Mohan Malaviya University of Technology, Gorakhpur, Up, India

Mrs. Meenu is an Associate Professor in the department of Computer Science & Engineering at the Madan Mohan Malaviya University of Technology, Gorakhpur where she has been a faculty member since 2003. She is Chairperson of Women Cell as well as Women Welfare and AntiHarassment Cell. She completed her M.Tech. at Madan Mohan Malaviya University of Technology. She has served as the Session Chair for UPCON-2018 (5th IEEE Uttar Pradesh Section International Conference). She is the author of 64 research papers, which have been published in various National & International Journals/Conferences. She is a reviewer of many International Journals/ Conferences and Editorial Board member of International Journals. She is also member of many Professional Societies. Her research interests lie in the area of Distributed Real Time Database Systems.She has collaborated actively with researchers in several other disciplines of computer science, particularly machine learning.  

References

C. J. B. K. C. L. K. R. a. Y. Z. J. R. Blumofe, “Cilk : An efficient multithreaded runtime system,” Journal of Parallel and Distributed Computing, vol. 37, no. 1, pp. 55-69, August 1996.

P. B. a. N. Goodman, “Concurrency Control in Distributed Database Systems,” ACM Computing Surveys, vol. 13, no. 2, p. 185 – 221, 1981.

B. R. a. M. M. S. Alexandru Turcu, “ On closed nesting in distributed transactional memory,” in Seventh ACM SIGPLAN workshop on Transactional Computing, 2012.

J. R. L. a. R. R. T. Harris, Transactional Memory, 2 ed., Synthesis Lectures on Computer Architecture Morgan & Claypool Publishers, 2010, pp. 1-247.

M. H. a. J. E. B. Moss, “Transactional memory: architectural support for lock-free data structures,” in Proceedings of the 20th annual international symposium on Computer architecture (ISCA '93)., May 1993.

N. &. T. D. Shavit, “Software transactional memory,” in Proceedings of the 14th Annual ACM Symposium on Principles of DistributedComputing, Ottawa, Can, 1995.

A. F. Y. L. V. L. M. M. D. N. Peter Damron, “Hybrid transactional memory,” in Proceedings of the 12th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2006, San Jose, CA, USA, October 21-25, 2006.

J. E. B. Moss, “Nested Transactions: An Approach to Reliable Distributed Computing,” Ph.D. Thesis, Technical Report MIT/LCS/TR-260,MIT Laboratory for Computer Science, Cambridge, MA, April 1981.

A. L. H. J. Eliot B. Moss, “Nested transactional memory: Model and architecture sketches,” Science of Computer Programming, vol. 63, no. 2, pp. 186-201, 2006.

N. C. J. Diegues, “Review of nesting in transactional memory,” Tech. rep., Technical Report RT/1/2012, Instituto Superior Técnico/INESC-ID , 2012.

G. A. Asi, “Performance Tradeoffs in Software Transactional Memory,” Master Thesis Computer Science, School of Computing Blekinge Institute of Technology, No:MCS-2010-28, Sweden, May 2010.

S. Classen, “LibSTM: A fast and flexible STM Library,” Master's Thesis, Laboratory for Software Technology, Swiss Federal Institute of Technology, ETH Zurich, Feb, 2008.

D. I. a. M. Raynal, “A Lock-Based STM Protocol That Satisfies Opacity and Progressiveness,” in Proceedings of the 12th International Conference on Principles of Distributed Systems (OPODIS'08, 2008.

W. N. S. I. a. M. L. Scott, “Contention Management in Dynamic Software Transactional Memory,” in Proceedings of the ACM PODC Workshop on Concurrency and Synchronization in Java Programs, Canada, July 2004.

I. N. S. a. M. L. S. y, “Advanced contention management for dynamic software transactional memory,” in Proceedings of the twenty-fourth annual ACM symposium on Principles of distributed computing, Las Vegas, NV, USA, 2005.

e. a. R. Guerraoui, “Toward a theory of transactional contention managers,” in Proceedings of the twenty-fourth annual ACM symposium on Principles of distributed computing, Las Vegas, NV, USA, 2005.

M. L. Scott, “Applications Included with RSTM WebPage,” [Online]. Available: http://www.cs.rochester.edu/research/synchronization/rstm/applications.shtml.

T. H. a. S. Stipic, “Abstract nested transactions,” in Second ACM SIGPLAN Workshop on Transactional Computing, 2007.

M. &. L. V. &. M. M. &. S. W. Herlihy, “ Software Transactional Memory for Dynamic-Sized Data Structures,” in Proceedings of the Annual ACM Symposium on Principles of Distributed Computing, 2003.

M. S. C. H. A. A. D. E. W. S. I. a. M. S. V. Marathe, “Lowering the overhead of Software Transactional Memory,” in 1st ACM SIGPLAN Workshop on Transactional Computing (TRANSACT '06), 2006 .

A.-R. A.-T. R. H. C. C. M. a. B. H. B. Saha, “McRT-STM: a high-performance Software Transactional Memory system for a multi-core runtime,” in SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP'06), 2006.

M. S. a. M. S. L. Dalessandro, “NOrec: Streamlining STM by abolishing ownership records,” in Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '10), 2010.

J. B. M. M. M. H. a. D. W. K. Moore, “LogTM: log-based transactional memory,” in Proceedings of the 12th High-Performance Computer Architecture International Symposium (HPCA '06), 2006.

J. B. K. E. M. L. Y. M. D. H. B. L. M. M. S. a. D. M. J. Moravan, “Supporting Nested Transactional Memory in LogTM,” in 12th International Conference on Architectural Support for Programming Languages and Operating Systems in SIGPLAN Notices (Proceedings of the 2006 ASPLOS Conference), 2006.

R. C. Ammlan Ghosh and Haskell, Implementing Software Transactional Memory using STM, vol. 2, Advanced Computing and Systems for Security ,Springer AISC, 2016, pp. 235-248.

M. R. Y. a. M. F. Le, “Revisiting software transactional memory in Haskell,” ACM SIGPLAN Notices, vol. 51, no. 12, pp. 105-113, 2016.

A. Du Bois, “An Implementation of Composable Memory Transactions in Haskell,” in Software Composition, SC 2011,Lecture Notes in Computer Science,Springer, Berlin, Heidelberg., 2011.

A. H. T. M. S. J. S. S. S. Discolo, “Lock Free Data Structures Using STM in Haskell,” in Functional and Logic Programming, FLOPS , 2006.

M. L. V. &. M. M. Herlihy, “A flexible framework for implementing software transactional memory,” ACM SIGPLAN Notices, vol. 41, no. 10, pp. 253-262, 2006.

S. M. S. P. J. a. M. H. T. Harris, “Composable memory transactions,” in Proceedings of the Tenth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP ’05, Chicago, IL, USA, 2005.

A. G. a. S. F. S. Peyton Jones, “Concurrent Haskell,” in 23rd ACM Symposium on Principles of Programming Languages (POPL’96), 1996.

A. T. a. B. Ravindran, “ On open nesting in distributed transactional memory,” in 5th Annual International Systems and Storage Conference (SYSTOR) ’12, 2012.

V. S. M. A.-R. A.-T. A. L. H. R. L. H. J. E. B. M. S. a. T. S. Y. Ni, “Open nesting in software transactional memory,” in PPoPP ’07: Proceedings of the 12th ACM SIGPLAN symposium on Principles and Practice of Parallel Programming ,ACM Press, New York, NY, USA, 2007.

A. M. H. C. J. C. C. M. C. K. a. K. O. B. Carlstrom, “The ATOMOS Transactional Programming Language,” in Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'06), 2006.

N. B. C. K. a. K. O. W. Baek, “Implementing and evaluating nested parallel transactions in software transactional memory,” in Proceedings of the 22nd ACM Symposium on Parallelism in Algorithms and Architectures, SPAA ’10,, Thira, Santorini, Greece, 2010.

R. K. a. K. Vidyasankar, “HParSTM: A Hierarchy-based STM Protocol for Supporting Nested Parallelism,” in 6th ACM SIGPLAN Workshop on Transactional Computing (TRANSACT '11), 2011.

A. W. A.-R. A.-T. T. S. X. T. a. R. N. H. Volos, “NePaLTM: Design and Implementation of Nested Parallelism for Transactional Memory Systems,” in Proceedings of the 23rd European Conference on Object-Oriented Programming(ECOOP '09), 2009.

J. T. F. a. J. S. K. Agrawal, “Nested parallelism in transactional memory,” in Proceedings of the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '08), 2008.

A. D. P. F. R. G. a. M. K. J. Barreto, “ Leveraging parallel nesting in transactional memory,” in Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '10).

H. R. a. E. Witchel, “The xfork in the road to coordinated sibling transactions,” in 4th ACM SIGPLAN Workshop on Transactional Computing (TRANSACT '09), 2009.

Authors

  • Meenu Meenu Madan Mohan Malaviya University of Technology, Gorakhpur, Up, India

DOI:

https://doi.org/10.31449/inf.v50i7.8356

Downloads

Published

02/21/2026

How to Cite

Meenu, M. (2026). Comparative Performance Analysis of Nested and Non-Nested Transactional Variables in Software Transactional Memory. Informatica, 50(7). https://doi.org/10.31449/inf.v50i7.8356