skip to main content
research-article

Type-based safe resource deallocation for shared-memory concurrency

Published:19 October 2012Publication History
Skip Abstract Section

Abstract

We propose a type system to guarantee safe resource deallocation for shared-memory concurrent programs by extending the previous type system based on fractional ownerships. Here, safe resource deallocation means that memory cells, locks, or threads are not left allocated when a program terminates. Our framework supports (1) fork/join parallelism, (2) synchronization with locks, and (3) dynamically allocated memory cells and locks. The type system is proved to be sound. We also provide a type inference algorithm for the type system and a prototype implementation of the algorithm.

References

  1. M. Abadi, C. Flanagan, and S. N. Freund. Types for safe locking: Static race detection for Java. ACM Trans. Prog. Lang. Syst., 28(2):207--255, Mar. 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Bornat, C. Calcagno, P. W. O'Hearn, and M. J. Parkinson. Permission accounting in separation logic. In Proc. of POPL, pages 259--270. ACM Press, Jan. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Boyland. Checking interference with fractional permissions. In Proceedings of SAS 2003, volume 2694 of LNCS, pages 55--72. Springer-Verlag, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Calcagno, D. Distefano, and V. Vafeiadis. Bi-abductive resource invariant synthesis. In Proceedings of APLAS 2009, pages 259--274, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. L. De Moura and N. Bjørner. Z3: an efficient SMT solver. In Proceedings of the Theory and practice of software, 14th international conference on Tools and algorithms for the construction and analysis of systems, TACAS'08/ETAPS'08, pages 337--340. Springer-Verlag, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. Gotsman, J. Berdine, B. Cook, N. Rinetzky, and M. Sagiv. Local reasoning for storable locks and threads. Technical Report MSR-TR-2007-39, Microsoft Research, 2007.Google ScholarGoogle ScholarCross RefCross Ref
  7. C. Haack, M. Huisman, and C. Hurlinc. Permission-based separation logic for multithreaded Java programs. http://fmt.cs.utwente.nl/files/projects/VerCors.p1.pdf.Google ScholarGoogle Scholar
  8. D. L. Heine and M. S. Lam. A practical flow-sensitive and context-sensitive C and C++ memory leak detector. In Proc. of PLDI, pages 168--181, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. IEEE. The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition, 2004. http://pubs.opengroup.org/onlinepubs/000095399/basedefs/pthread.h.html.Google ScholarGoogle Scholar
  10. P. W. O'Hearn. Resources, concurrency, and local reasoning. Theor. Comput. Sci., 375(1-3):271--307, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. K. Suenaga. Type-based deadlock-freedom verification for non-block-structured lock primitives and mutable references. In G. Ramalingam, editor, Programming Languages and Systems, 6th Asian Symposium, APLAS 2008, Bangalore, India, volume 5536 of LNCS, pages 155--170. Springer, Dec. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. Suenaga and N. Kobayashi. Fractional ownerships for safe memory deallocation. In Z. Hu, editor, Programming Languages and Systems, 7th Asian Symposium, APLAS 2009, volume 5904 of Lecture Notes in Computer Science, pages 128--143. Springer-Verlag, Dec. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Swamy, M. W. Hicks, G. Morrisett, D. Grossman, and T. Jim. Safe manual memory management in Cyclone. Sci. Comput. Program., 62(2):122--144, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. Terauchi. Checking race freedom via linear programming. In Proc. of PLDI, pages 1--10, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Tofte and J.-P. Talpin. Region-based memory manage-ment. Info. Comput., 132(2):109--176, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. K. Ueda. Resource-passing concurrent programs. In Proceedings of 4th International Symposium on Theoretical Aspects of Computer Science (TACS2001), volume 2215 of LNCS, pages 95--126. Springer-Verlag, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Walker, K. Crary, and J. G. Morrisett. Typed memory management via static capabilities. ACM Trans. Prog. Lang. Syst., 22(4):701--771, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Type-based safe resource deallocation for shared-memory concurrency

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!