Channels as Objects in Concurrent Object-Oriented Programming

Joana Campos
(University of Lisbon)
Vasco T. Vasconcelos
(University of Lisbon)

There is often a sort of a protocol associated to each class, stating when and how certain methods should be called. Given that this protocol is, if at all, described in the documentation accompanying the class, current mainstream object-oriented languages cannot provide for the verification of client code adherence against the sought class behaviour. We have defined a class-based concurrent object-oriented language that formalises such protocols in the form of usage types. Usage types are attached to class definitions, allowing for the specification of (1) the available methods, (2) the tests clients must perform on the result of methods, and (3) the object status - linear or shared - all of which depend on the object's state. Our work extends the recent approach on modular session types by eliminating channel operations, and defining the method call as the single communication primitive in both sequential and concurrent settings. In contrast to previous works, we define a single category for objects, instead of distinct categories for linear and for shared objects, and let linear objects evolve into shared ones. We introduce a standard sync qualifier to prevent thread interference in certain operations on shared objects. We formalise the language syntax, the operational semantics, and a type system that enforces by static typing that methods are called only when available, and by a single client if so specified in the usage type. We illustrate the language via a complete example.

In Kohei Honda and Alan Mycroft: Proceedings Third Workshop on Programming Language Approaches to Concurrency and communication-cEntric Software (PLACES 2010), Paphos, Cyprus, 21st March 2010, Electronic Proceedings in Theoretical Computer Science 69, pp. 12–28.
Published: 18th October 2011.

ArXived at: https://dx.doi.org/10.4204/EPTCS.69.2 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org