Skip to main content
Log in

Formal Reasoning About Lazy-STM Programs

  • Regular Paper
  • Published:
Journal of Computer Science and Technology Aims and scope Submit manuscript

Abstract

Transactional memory (TM) is an easy-using parallel programming model that avoids common problems associated with conventional locking techniques. Several researchers have proposed a large amount of alternative hardware and software TM implementations. However, few ones focus on formal reasoning about these TM programs. In this paper, we propose a framework at assembly level for reasoning about lazy software transactional memory (STM) programs. First, we give a software TM implementation based on lightweight locks. These locks are also one part of the shared memory. Then we define the semantics of the model operationally, and the lightweight locks in transaction are non-blocking, avoiding deadlocks among transactions. Finally we design a logic — a combination of permission accounting in separation logic and concurrent separation logic — to verify various properties of concurrent programs based on this machine model. The whole framework is formalized using a proof-carrying-code (PCC) framework.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Herlihy M, Moss J E B. Transactional memory: Architectural support for lock-free data structures. In Proc. the 20th Annual International Symposium on Computer Architecture (ISCA1993), San Diego, US, May 1993, pp.289-300.

  2. Hammond L, Wong V, Chen M et al. Transactional memory coherence and consistency. In Proc. the 31st Annual International Symposium on Computer Architecture (ISCA2004), München, Germany, Jun. 19-23, 2004, p.102.

  3. Ananian C S, Asanovic K, Kuszmaul B C et al. Unbounded transactional memory. In Proc. the 11th International Symposium on High-Performance Computer Architecture (HPCA2005), San Francisco, US, Feb. 12-16, 2005, pp.316-327.

  4. Moore K E, Grossman D. Log-based transactional memory. In Proc. The Twelfth International Symposium on High-Performance Computer Architecture, Austin, USA, Feb. 11-15, 2006, pp.254-265.

  5. Shavit N, Touitou D. Software transactional memory. In Proc. the 14th Annual ACM Symposium on Principles of Distributed Computing (PODC 1995), Ottawa, Canada, Aug. 20-23, 1995, pp.204-213.

  6. Harris T, Fraser K. Language support for lightweight transactions. In Proc. the 18th Annual ACM SIGPLAN Conference on Object-Oriented Programing, Systems, Languages, and Applications (OOPSLA2003), Anaheim, USA, Oct. 26-30, 2003, pp.388-402.

  7. Saha B, Adl-Tabatabai A R, Hudson R L, Minh C C, Hertzberg B.McRT-STM: A high performance software transactional memory system for a multi-core runtime. In Proc. the Eleventh ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP 2006), New York, USA, Mar. 29-31, 2006, pp.187-197.

  8. Herlihy M, Luchangco V, Moir M, Scherer W N III. Software transactional memory for dynamic-sized data structures. In Proc. the 22nd Annual Symposium on Principles of Distributed Computing (PODC2003), Boston, USA, July 13-16, 2003, pp.92-101.

  9. Dice D, Shalev O, Shavit N. Transactional locking II. In Proc. International Symposium on Distributed Computing, Stockholm, Sweden, Sept. 18-20, 2006, pp.194-208.

  10. Felber P, Fetzer C, Riegel T. Dynamic performance tuning of word-based software transactional memory. In Proc. the 13th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP 2008), Salt Lake City, USA, Feb. 20-23, 2008, pp.237-246.

  11. Kumar S, Chu M, Hughes C J, Kundu P, Nguyen A. Hybrid transactional memory. In Proc. the 11th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP 2006), New York, USA, Mar. 29-31, 2006, pp.209-220.

  12. Liblit B. An operational semantics for LogTM. Technical Report 1571, University of Wisconsin-Madison, August 2006.

  13. Martin M, Blundell C, Lewis E. Subtleties of transactional memory atomicity semantics. IEEE Computer Architecture Letters, 2006, 5(2): 17.

    Article  Google Scholar 

  14. Moore K F, Grossman D. High-level small-step operational semantics for transactions. In Proc. the 13th ACM SIGPLAN Symposium on Principles and Practices of Parallel Programming (PPoPP 2008), Salt Lake City, USA, Feb. 20-22, 2008, pp.51-62.

  15. Li L, Zhang Y, Chen Y, Li Y. Certifying concurrent programs using transactional memory. Journal of Computer Science and Technology, Jan. 2009, 24(1): 110-121.

    Article  MathSciNet  Google Scholar 

  16. O’Hearn P W. Resources, concurrency, and local reasoning. Theor. Comput. Sci., 2007, 375(1-3): 271-307.

    Article  MathSciNet  MATH  Google Scholar 

  17. Bornat R, Calcagno C, O’Hearn P, Parkinson M. Permission accounting in separation logic. In Proc. the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2005), Long Beach, USA, Jan. 12-14, 2005, pp.259-270.

  18. The Coq proof assistant reference manual. Coq release v8.1, Coq Development Team, October 2006.

  19. Yu D, Shao Z. Verification of safety properties for concurrent assembly code. In Proc. the 2004 ACM SIGPLAN International Conference on Functional Programming (ICFP 2004), Snow Bird, USA, Sept. 19-21, 2004, pp.175-188.

  20. Feng X, Shao Z. Modular verification of concurrent assembly code with dynamic thread creation and termination. In Proc. the 2005 ACM SIGPLAN International Conference on Functional Programming (ICFP 2005), Tallinn, Estonia, Sept. 26-28, 2005, pp.254-267.

  21. Li Y, Zhang Y, Chen Y, Fu M. On the verification of strong atomicity of programs using STM. In Proc. the 3rd IEEE Int. Conf. Secure Software Integration and Reliability Improvement (SSIRI 2009), Shanghai, China, July 8-10, 2009, pp.123-131.

  22. Reynolds J C. Separation logic: A logic for shared mutable data structures. In Proc, the 17th Annual IEEE Symposium on Logic in Computer Science (LICS 2002), Copenhagen, Denmark, July 22-25, 2002, pp.55-74.

  23. Feng X, Shao Z, Vaynberg A, Xiang S, Ni Z. Modular verification of assembly code with stack-based control abstractions. In Proc. the 2006 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2006), Ottawa, Canada, Jun. 10-16, 2006, pp.401-414.

  24. Wright A K, Felleisen M. A syntactic approach to type soundness. Information and Computation, 1994, 115(1): 38-94.

    Article  MathSciNet  MATH  Google Scholar 

  25. Li Y. Coq implementation for formal reasoning about concurrent programs using a lazy-STM system. http://ssg.ustcsz.edu.cn/content/formal-reasoning-about-lazy-stm-programs.

  26. Jones C B. Tentative steps toward a development method for interfering programs. Transactions on Programming Languages and Systems., 1983, 5(4): 596-619.

    Article  MATH  Google Scholar 

  27. Brookes S. A grainless semantics for parallel programs with shared mutable data. Electron. Notes Theor. Comput. Sci., 2006, 155: 277-307.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yu Zhang.

Additional information

Supported by the National Natural Science Foundation of China under Grant Nos. 60928004 and 90718026; and Intel China Research Center. Any opinions, findings, and conclusions contained in this document are those of the authors and do not reflect the views of these agencies.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Li, Y., Zhang, Y., Chen, YY. et al. Formal Reasoning About Lazy-STM Programs. J. Comput. Sci. Technol. 25, 841–852 (2010). https://doi.org/10.1007/s11390-010-9369-2

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11390-010-9369-2

Keywords

Navigation