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
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
T. Araki, N. Tokura: “Flow Languages Equal Recursively Enumerable Languages.” Acta Informatica 15, 1981, 209-217.
P. Brinch Hansen: “A Comparison of Two Synchronizing Concepts.” Acta Informatica 1 (3) 1972, 190–199.
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.
P. J. Courtois, F. Heymans, D. L. Parnas: “Concurrent Control with “Readers” and “Writers”.” Communications of the ACM 14 (10) October 1971, 667–668.
L. Guo, K. Salomaa, S. Yu: “On Synchronization Languages.” Fundamenta Informaticae 25 (3+4) March 1996, 423–436.
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.
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.
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.
C. A. R. Hoare: “Monitors: An Operating System Structuring Concept.” Communications of the ACM 17 (10) October 1974, 549–557.
J. E. Hopcroft, J. D. Ullman: Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading, MA, 1979.
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).
J. L. Keedy, G. Menger, C. Heinlein, F. Henskens: Qualifying Types Illustrated by Synchronization Examples. In this volume.
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.
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.
D. Lea: Concurrent Programming in Java. Design Principles and Patterns (Second Edition). Addison-Wesley, Reading, MA, 2000.
S. Oaks, H. Wong: Java Threads. O’Reilly, Sebastopol, CA, 1999.
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.
W. E. Riddle: “An Approach to Software System Behavior Description.” Computer Languages 4, 1979, 29–47.
A. C. Shaw: “Software Description with Flow Expressions.” IEEE Transactions on Software Engineering SE-4 (3) May 1978, 242–254.
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.
A. Williams: “Java Parsing Made Easy.” Web Techniques 9/2001, September 2001, http://www.webtechniques.com/archives/2001/09/java.
P. H. Winston, B. K. P. Horn: LISP (Third Edition). Addison-Wesley, Reading, MA, 1989.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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