skip to main content
10.1145/2103786.2103791acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Types for relaxed memory models

Published: 28 January 2012 Publication History

Abstract

Multicore computers implementing weak memory models are mainstream, yet type-based analyses of these models remain rare. We help fill this gap. We not only prove the soundness of a type system for a weak execution model, but we also show that interesting properties of that model can be embedded in the types themselves.
We argue that correspondence assertions can be used in a programming discipline that captures happens-before relationships, which are the basis for reasoning about weak memory in Java. This programming discipline is flexible and can be statically enforced. We present several examples from java.util.concurrent and prove the static semantics sound with respect to an execution model based on Java's memory model.

References

[1]
M. Abadi, C. Flanagan, and S. N. Freund. Types for safe locking: Static race detection for Java. TOPLAS, 28 (2): 207--255, 2006.
[2]
S. V. Adve and K. Gharachorloo. Shared memory consistency models: A tutorial. Computer, 29 (12): 66--76, 1996.
[3]
J. Alglave, D. Kroening, J. Lugton, V. Nimal, and M. Tautschnig. Soundness of data flow analyses for weak memory models. In APLAS, 2011.
[4]
H.-J. Boehm and S. V. Adve. Foundations of the C++ concurrency memory model. In PLDI'08, pages 68--78, 2008.
[5]
G. Boudol and G. Petri. Relaxed memory models: an operational approach. In POPL, pages 392--403, 2009.
[6]
S. Burckhardt, P. Kothari, M. Musuvathi, and S. Nagarakatte. A randomized scheduler with probabilistic guarantees of finding bugs. In ASPLOS, pages 167--178, 2010.
[7]
P. Cenciarelli, A. Knapp, and E. Sibilio. The Java memory model: Operationally, denotationally, axiomatically. In ESOP, pages 331--346, 2007.
[8]
P. Ferrara. Static analysis via abstract interpretation of the happens-before memory model. In TAP, pages 116--133, 2008.
[9]
C. Flanagan and S. N. Freund. Fasttrack: efficient and precise dynamic race detection. In PLDI, pages 121--133, 2009.
[10]
B. Goetz, T. Peierls, J. Bloch, J. Bowbeer, D. Holmes, and D. Lea. Java Concurrency in Practice. Addison-Wesley Professional, 2005.
[11]
A. D. Gordon and A. Jeffrey. Typing correspondence assertions for communication protocols. Theor. Comput. Sci., 300: 379--409, 2003.
[12]
C. Hawblitzel. Linear types for aliased resources. Technical Report MSR-TR-2005--141, Microsoft Research, 2005.
[13]
A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM TOPLAS, 23 (3): 396--450, 2001.
[14]
R. Jagadeesan, C. Pitcher, and J. Riely. Generative operational semantics for relaxed memory models. In ESOP, 2010.
[15]
L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess program. IEEE Trans. Comput., 28 (9): 690--691, 1979.
[16]
D. Lea. The JSR-133 cookbook for compiler writers. http://gee.cs.oswego.edu/dl/jmm/cookbook.html, 2008.
[17]
J. M. Lucassen and D. K. Gifford. Polymorphic effect systems. In POPL, pages 47--57, 1988.
[18]
J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In POPL'05, pages 378--391, 2005.
[19]
A. Miné. Static analysis of run-time errors in embedded critical parallel c programs. In ESOP, pages 398--418, 2011.
[20]
V. A. Saraswat. Concurrent constraint-based memory machines: A framework for Java memory models. In ASIAN, 2004.
[21]
J. Sevcík. Program Transformations in Weak Memory Models. PhD, Univ. of Edinburgh, 2008.
[22]
J. Sevcík and D. Aspinall. On validity of program transformations in the Java memory model. In ECOOP, pages 27--51, 2008.
[23]
J. Sevcík, V. Vafeiadis, F. Z. Nardelli, S. Jagannathan, and P. Sewell. Relaxed-memory concurrency and verified compilation. In POPL, 2011.
[24]
P. Sewell. Global/local subtyping and capability inference for a distributed π-calculus. In ICALP'98, LNCS 1443, pages 695--706, 1998.
[25]
R. C. Steinke and G. J. Nutt. A unified theory of shared memory consistency. J. ACM, 51 (5): 800--849, 2004.
[26]
T. Terauchi and A. Aiken. Witnessing side effects. TOPLAS, 30 (3), 2008.
[27]
T. Y. C. Woo and S. S. Lam. Authentication for distributed systems. IEEE Computer, 25: 39--52, January 1992.
[28]
T. Zhao, J. Palsberg, and J. Vitek. Type-based confinement. J. Funct. Program., 16: 83--128, January 2006.

Cited By

View all
  • (2018)On the behaviour of general purpose applications on cloud storagesService Oriented Computing and Applications10.1007/s11761-014-0165-79:3-4(213-227)Online publication date: 13-Dec-2018
  • (2018)Mechanising a Type-Safe Model of Multithreaded Java with a Verified CompilerJournal of Automated Reasoning10.1007/s10817-018-9452-x61:1-4(243-332)Online publication date: 1-Jun-2018
  • (2016)On Thin Air Reads Towards an Event Structures Model of Relaxed MemoryProceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/2933575.2934536(759-767)Online publication date: 5-Jul-2016
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
TLDI '12: Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation
January 2012
110 pages
ISBN:9781450311205
DOI:10.1145/2103786
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 January 2012

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Conference

POPL '12
Sponsor:

Acceptance Rates

Overall Acceptance Rate 11 of 26 submissions, 42%

Upcoming Conference

POPL '26

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)0
Reflects downloads up to 05 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2018)On the behaviour of general purpose applications on cloud storagesService Oriented Computing and Applications10.1007/s11761-014-0165-79:3-4(213-227)Online publication date: 13-Dec-2018
  • (2018)Mechanising a Type-Safe Model of Multithreaded Java with a Verified CompilerJournal of Automated Reasoning10.1007/s10817-018-9452-x61:1-4(243-332)Online publication date: 1-Jun-2018
  • (2016)On Thin Air Reads Towards an Event Structures Model of Relaxed MemoryProceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science10.1145/2933575.2934536(759-767)Online publication date: 5-Jul-2016
  • (2014)Making the java memory model safeACM Transactions on Programming Languages and Systems10.1145/251819135:4(1-65)Online publication date: 3-Jan-2014
  • (2014)On the Behaviour of General-Purpose Applications on Cloud StoragesWeb Services and Formal Methods10.1007/978-3-319-08260-8_3(29-47)Online publication date: 25-Jun-2014

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media