Skip to main content

Shared-Variable Programs

  • Chapter
  • 2065 Accesses

Part of the book series: Texts in Computer Science ((TCS))

Abstract

This chapter shows how one can write a compiler in CSP M and base a tool around the result. In this case that compiler is for shared variable programs, so this chapter is also an introduction to that subject. We study this through examples such as mutual exclusion, including Lamport’s bakery algorithm, and the dining philosophers. The compiler is based on programs described in a CSP data type, which is generated and interpreted by the front end of the tool, which we call SVA. SVA, a front end for FDR, is available from this book’s web site.

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   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   54.99
Price excludes VAT (USA)
  • Durable hardcover 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

Notes

  1. 1.

    We will be studying two forms of the language: first a somewhat unconventional one that is closer to implementation and then a more conventional one that is what most users will actually write. We will allow locally defined variables in the latter.

  2. 2.

    This was an exercise set for a number of years by Oxford lecturers, originally by David Walker. This exercise and the paper [155] on which it was based inspired the creation of the compiler described in the present chapter.

  3. 3.

    The SVA front end allows more conventional names for variables, and builds up a table associating each such name with one derived from namestype.

  4. 4.

    A perhaps superior approach would be to transform each thread so that every read of the “non-variable” becomes a constant equal to its initial value. This would work for simple variables, but not for array components: an array of constants is, in effect, a look-up table.

  5. 5.

    This is just an example of a paper where this version is used. The author is not sure where it originated.

References

  1. Börger, E., Gurevich, Y., Rozenweig, D.: The Bakery Algorithm: yet another specification and verification. In: Specification and Verification Methods. Oxford University Press, London (1995)

    Google Scholar 

  2. Clarke, E.M., Grumberg, O., Hamaguchi, K.: Another look at LTL model checking. Form. Methods Syst. Des. 10, 1 (1997)

    Google Scholar 

  3. Dijkstra, E.W.: Cooperating sequential processes. In: The Origin of Concurrent Programming: from Semaphores to Remote Procedure Calls. Springer, Berlin (2002) (paper originally published in 1965)

    Google Scholar 

  4. Hoare, C.A.R.: Monitors: An operating system structuring concept. Commun. ACM 17, 10 (1974)

    Article  Google Scholar 

  5. Hoare, C.A.R.: Communicating Sequential Processes. Prentice Hall, New York (1985)

    MATH  Google Scholar 

  6. Hopcroft, P.J., Broadfoot , G.H.: Combining the box structure development method and CSP. Automated Software Engineering (2004)

    Google Scholar 

  7. Hopkins, D., Roscoe, A.W.: SVA, a tool for analysing shared-variable programs. In: Proceedings of AVoCS (2007)

    Google Scholar 

  8. Hyman, H.: Comments on a problem in concurrent programming control. CACM 9, 1 (1966)

    Article  Google Scholar 

  9. Lamport, L.: A new solution of Dijkstra’s concurrent programming problem. Commun. ACM 17, 8 (1974)

    MathSciNet  Google Scholar 

  10. Lowe, G.: Casper: a compiler for the analysis of security protocols. In: Proceedings of CSFW (1997)

    Google Scholar 

  11. Peterson, J.L., Silberschatz, A.: Operating System Concepts, 2nd edn. Addison Wesley, Reading (1985)

    Google Scholar 

  12. Roscoe, A.W.: Compiling Shared variable programs into CSP. In: Proceedings of PROGRESS Workshop (2001)

    Google Scholar 

  13. Walker, D.J.: Automated analysis of mutual exclusion algorithms using CCS. Form. Asp. Comput. 1, 1 (1989)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to A. W. Roscoe .

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag London Limited

About this chapter

Cite this chapter

Roscoe, A.W. (2010). Shared-Variable Programs. In: Understanding Concurrent Systems. Texts in Computer Science. Springer, London. https://doi.org/10.1007/978-1-84882-258-0_18

Download citation

  • DOI: https://doi.org/10.1007/978-1-84882-258-0_18

  • Publisher Name: Springer, London

  • Print ISBN: 978-1-84882-257-3

  • Online ISBN: 978-1-84882-258-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics