Skip to main content

From Total Store Order to Sequential Consistency: A Practical Reduction Theorem

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6172))

Abstract

When verifying a concurrent program, it is usual to assume sequentially consistent memory. However, most modern multiprocessors buffer their stores, providing native sequential consistency only at a substantial performance penalty. To regain sequential consistency, a programmer has to follow an appropriate programming discipline. However, existing naïve disciplines, such as protecting all shared accesses with locks to avoid data races, or flushing store buffers according to a protocol that allows arbitrary data races, are not flexible enough for building high-performance multiprocessor software. We present a new discipline for concurrent programming under TSO (total store order, with store buffer forwarding). Instead of using concurrency primitives, such as locks, it is based on maintaining ownership information in ghost state, allowing the discipline to be expressed as a state invariant and verified through conventional program reasoning. If every execution of a program in a system without store buffers follows the discipline, then every execution of the program in a system with store buffers is sequentially consistent.

Work funded by the German Federal Ministry of Education and Research (BMBF) in the framework of the Verisoft XT project under grant 01 IS 07 008.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Advanced Micro Devices (AMD), Inc. AMD64 Architecture Programmer’s Manual: Vol. 1-3, rev. 3.14 (September 2007)

    Google Scholar 

  2. Adve, S.V., Gharachorloo, K.: Shared memory consistency models: A tutorial. IEEE Computer 29(12), 66–76 (1996)

    Google Scholar 

  3. Aspinall, D., Sevcík, J.: Formalising Java’s data race free guarantee. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 22–37. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  4. Burckhardt, S., Musuvathi, M.: Effective program verification for relaxed memory models. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  5. Cohen, E., Schirmer, N.: A better reduction theorem for store buffers. Technical report (2009), http://arxiv.org/abs/0909.4637v1

  6. Cohen, E., et al.: VCC: A practical system for verifying concurrent C. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds.) TPHOLs 2009. LNCS, vol. 5674, pp. 1–22. Springer, Heidelberg (2009)

    Google Scholar 

  7. Sarkar, S., et al.: The semantics of x86 multiprocessor machine code. In: POPL ’09, January 2009, pp. 379–391. ACM Press, New York (2009)

    Google Scholar 

  8. Intel. Intel 64 architecture memory ordering white paper. SKU 318147-001 (2007)

    Google Scholar 

  9. Intel Corporation. Intel 64 and IA-32 Architectures Software Developer’s Manual: Vol. 1-3b, rev. 29 (March 2009)

    Google Scholar 

  10. Nipkow, T., Paulson, L.C., Wenzel, M.T.: Isabelle/HOL. LNCS, vol. 2283. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  11. Owens, S.: Reasoning about the implementation of concurrency abstractions on x86-TSO. In: ECOOP 2010 (to appear, 2010)

    Google Scholar 

  12. Owens, S., Sarkar, S., Sewell, P.: A better x86 memory model: x86-TSO. In: TPHOLs 2009. LNCS. Springer, Heidelberg (2009)

    Google Scholar 

  13. Ridge, T.: Operational reasoning for concurrent caml programs and weak memory models. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 278–293. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  14. Sevcík, J., Aspinall, D.: On validity of program transformations in the Java memory model. In: Vitek, J. (ed.) ECOOP 2008. LNCS, vol. 5142, pp. 27–51. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Cohen, E., Schirmer, B. (2010). From Total Store Order to Sequential Consistency: A Practical Reduction Theorem. In: Kaufmann, M., Paulson, L.C. (eds) Interactive Theorem Proving. ITP 2010. Lecture Notes in Computer Science, vol 6172. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14052-5_28

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-14052-5_28

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-14051-8

  • Online ISBN: 978-3-642-14052-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics