Skip to main content

Advanced Thread Synchronization in Java Using Interaction Expressions

  • Conference paper
  • First Online:
  • 535 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2591))

Abstract

Thread synchronization in Java using synchronized methods or statements is simple and straightforward as long as mutual exclusion of threads is sufficient for an application. Things become less straightforward when wait() andnotify() have to be employed to realize more flexible synchronization schemes. Using two well-known examples, the bounded buffer and the readers and writers problem, the traps and snares of hand-coded synchronization code and its entanglement with the actual application code are illustrated. Following that, interaction expressions are introduced as a completely different approach where synchronization problems are solved in a declarative way by simply specifying permissible execution sequences of methods. Their integration into the Java programming language using a simple precompiler and the basic ideas to enforce at run time the synchronization constraints specified that way are described.

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 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

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. T. Araki, N. Tokura: “Flow Languages Equal Recursively Enumerable Languages.” Acta Informatica 15, 1981, 209-217.

    Google Scholar 

  2. P. Brinch Hansen: “A Comparison of Two Synchronizing Concepts.” Acta Informatica 1 (3) 1972, 190–199.

    Article  Google Scholar 

  3. R. H. Campbell, A. N. Habermann: “The Specification of Process Synchronization by Path Expressions.” In: E. Gelenbe, C. Kaiser (eds.): Operating Systems (International Symposium; Rocquencourt, France, April 1974; Proceedings). Lecture Notes in Computer Science 16, Springer-Verlag, Berlin, 1974, 89–102.

    Google Scholar 

  4. P. J. Courtois, F. Heymans, D. L. Parnas: “Concurrent Control with “Readers” and “Writers”.” Communications of the ACM 14 (10) October 1971, 667–668.

    Article  Google Scholar 

  5. L. Guo, K. Salomaa, S. Yu: “On Synchronization Languages.” Fundamenta Informaticae 25 (3+4) March 1996, 423–436.

    MATH  MathSciNet  Google Scholar 

  6. C. Heinlein: Workflow and Process Synchronization with Interaction Expressions and Graphs. Ph. D. Thesis (in German), Fakultät für Informatik, Universität Ulm, 2000.

    Google Scholar 

  7. C. Heinlein: “Workflow and Process Synchronization with Interaction Expressions and Graphs.” In: Proc. 17th Int. Conf. on Data Engineering (ICDE) (Heidelberg, Germany, April 2001). IEEE Computer Society, 2001, 243–252.

    Google Scholar 

  8. C. Heinlein: “Synchronization of Concurrent Workflows Using Interaction Expressions and Coordination Protocols.” In: R. Meersman, Z. Tari (eds.): On the Move to Meaningful Internet Systems 2002: CoopIS, DOA, and ODBASE (Confederated International Conferences; CoopIS, DOA, and ODBASE 2002; Proceedings). Lecture Notes in Computer Science 2519, Springer-Verlag, Berlin, 2002, 54–71.

    Chapter  Google Scholar 

  9. C. A. R. Hoare: “Monitors: An Operating System Structuring Concept.” Communications of the ACM 17 (10) October 1974, 549–557.

    Article  MATH  Google Scholar 

  10. J. E. Hopcroft, J. D. Ullman: Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading, MA, 1979.

    MATH  Google Scholar 

  11. J. L. Keedy, M. Evered, A. Schmolitzky, G. Menger: “Attribute Types and Bracket Implementations.” In: Proc. 25th Int. Conf. on Technology of Object-Oriented Languages and Systems (TOOLS Pacific) (Melbourne, Australia, 1997).

    Google Scholar 

  12. J. L. Keedy, G. Menger, C. Heinlein, F. Henskens: Qualifying Types Illustrated by Synchronization Examples. In this volume.

    Google Scholar 

  13. G. Kiczales, J. Lamping, A. Mendhekar, C. Maeda, C. V. Lopes, J. Loingtier, J. Irwin: “Aspect-Oriented Programming.” In: M. Aksit (ed.): ECOOP’97-Object-Oriented Programming (11th European Conference; Jyväskylä, Finland, June 1997; Proceedings). Lecture Notes in Computer Science 1241, Springer-Verlag, Berlin, 1997.

    Chapter  Google Scholar 

  14. G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, W. G. Griswold: “An Overview of AspectJ.” In: J. Lindskov Knudsen (ed.): ECOOP 2001-Object-Oriented Programming (15th European Conference; Budapest, Hungary, June 2001; Proceedings). Lecture Notes in Computer Science 2072, Springer-Verlag, Berlin, 2001.

    Chapter  Google Scholar 

  15. D. Lea: Concurrent Programming in Java. Design Principles and Patterns (Second Edition). Addison-Wesley, Reading, MA, 2000.

    Google Scholar 

  16. S. Oaks, H. Wong: Java Threads. O’Reilly, Sebastopol, CA, 1999.

    Google Scholar 

  17. W. F. Ogden, W. E. Riddle, W. C. Rounds: “Complexity of Expressions Allowing Concurrency.” In: Proc. 5th ACM Symp. on Principles of Programming Languages. 1978, 185–194.

    Google Scholar 

  18. W. E. Riddle: “An Approach to Software System Behavior Description.” Computer Languages 4, 1979, 29–47.

    Article  MATH  Google Scholar 

  19. A. C. Shaw: “Software Description with Flow Expressions.” IEEE Transactions on Software Engineering SE-4 (3) May 1978, 242–254.

    Article  Google Scholar 

  20. A. C. Shaw: “On the Specification of Graphics Command Languages and Their Processors.” In: R. A. Guedj, P. J. W. ten Hagen, F. R. A. Hopgood, H. A. Tucker, D. A. Duce (eds.): Methodology of Interaction (IFIP Workshop on Methodology of Interaction; Seillac, France, May 1979). North-Holland Publishing Company, Amsterdam, 1980, 377–392.

    Google Scholar 

  21. A. Williams: “Java Parsing Made Easy.” Web Techniques 9/2001, September 2001, http://www.webtechniques.com/archives/2001/09/java.

  22. P. H. Winston, B. K. P. Horn: LISP (Third Edition). Addison-Wesley, Reading, MA, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Heinlein, C. (2003). Advanced Thread Synchronization in Java Using Interaction Expressions. In: Aksit, M., Mezini, M., Unland, R. (eds) Objects, Components, Architectures, Services, and Applications for a Networked World. NODe 2002. Lecture Notes in Computer Science, vol 2591. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-36557-5_25

Download citation

  • DOI: https://doi.org/10.1007/3-540-36557-5_25

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-00737-1

  • Online ISBN: 978-3-540-36557-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics