Chapter 6
- The object-oriented community
has originally adopted the client/server
metaphor from the distributed
computing community.
The client/server model intrinsically
supports concurrency and active objects.
See slide
[6-modeling].
- There are three ways to extend
an object-oriented language with
concurrency:
add processes as an orthogonal concept;
introduce active objects;
or allow for asynchronous communication.
See slide
[6-support].
- Active objects unify the characteristics
of objects and processes.
To communicate with active objects,
message passing must be extended to
communication by rendezvous.
See section
[active].
- Issues in developing a concurrent
extension of C++ are:
the combination of objects and processes;
how to resolve communication and synchronization;
and whether to support inheritance.
See slide
[6-issues].
- Concurrent C++ is meant as an orthogonal
extension of both C++ and Concurrent C.
See slide
[6-orthogonal].
It offers processes in addition to objects,
yet allows for encapsulating
processes in objects.
See slide [6-cc-encapsulation].
- The original actor model supports
active objects, of which the behavior
is defined by scripts,
asynchronous communication between
actors via mailboxes and behavioral
replacement, that allows for an actor
to change its behavior after responding
to a message.
The actor model supported by ACT++
is considerably simpler.
It supports only synchronous communication
and defines behavior replacement
through refinement by inheritance.
See slides
[sli-6-act] and [sli-6-act-refinement].
- {}C++ extends C++ with a variety of
concurrency and synchronization
features, including
monitors and tasks supporting communication
by rendezvous.
See slide
[6-mu].
Compositional C++ allows for the creation
of processes and supports synchronization
by write-once variables.
See slide [6-compositional].
- The problem is known
as the inheritance anomaly,
which amounts to the observation that
the object's own activity and synchronization
aspects must usually be redefined when
inheriting from an active object.
See slide
[6-anomaly].
- An example of employing
inheritance for processes is given
in slide
[6-dtd].
The solution given, however, requires
multi-threaded active objects.
- An important problem is fault-tolerance.
See slide
[6-transparency].
Another issue that must be dealt with
is the inefficiency of remote invocations.
One may think of replication strategies
to reduce the traffic of data involved.
See slide [6-dual].