Advanced Thread Synchronization in Java Using Interaction Expressions

  • Authors:
  • Christian Heinlein

  • Affiliations:
  • -

  • Venue:
  • NODe '02 Revised Papers from the International Conference NetObjectDays on Objects, Components, Architectures, Services, and Applications for a Networked World
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

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() and notify() 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.