Next: Triveni: Design and Implementation
Up: Objects and Concurrency in
Previous: Organization of the paper
Triveni: Basis
Triveni is a programming methodology for concurrent programming with
threads and events. Triveni has its basis in process algebras (e.g.,
CCS [Mil89], CSP [Hoa85]) and synchronous programming
languages (e.g., see [Hal93]). The key feature of these
formalisms is a notion of abstract behavior, which in a
concurrent system is essentially the interaction of the system with
its environment. Communication is via (labeled) events that
are abstractions of names of communication channels. Triveni has the
following features:
- Programs can be combined freely with the Triveni combinators, and
one need only be concerned about the desired effects on the
resulting behavior. Thus, Triveni combinators operate on behaviors and
the result of the combinators are behaviors: the implementation of
Triveni yields the correct combination of behaviors.
- Triveni enables parallel composition to be used freely for the
modular decomposition of designs. In particular, the
parallel composition of Triveni programs yields programs that are
indistinguishable from simple ones (in much the same way that an
object built by object composition has the same status as a simple
object).
The correct wiring among events sent by parallel components is
done automatically by Triveni, and thus, the implementation of a program
can closely reflect its design. Namely, each parallel component can be
implemented separately: Triveni realizes the desired
communication among them.
- Triveni supports exceptions via preemption combinators. For
example, the watchdog combinator DO P WATCHING e yields
a process that behaves like P until event e happens,
upon which execution of P is terminated (in the spirit of
``Ctrl-C''). Analogous to exception mechanisms in traditional
programming languages, the preemption combinators aid in program
modularity; for example, the watchdog above avoids the pollution of
P with information about the event e.
In Triveni, exceptions have first class status -- any event can be an
exception and can be used in the place of e in the
watchdog. This allows exceptions to play an integral role in in the
programming of systems.
Priorities on events are achieved by nesting of the preemption
operators; for example, the event e2 has higher priority than
the event e1 in the program fragment DO (DO P WATCHING
e1) WATCHING e2. These priorities are not fixed by
Triveni; they are determined by the program/design text.
- Triveni is compatible with the extensive existing work in both
the design and implementation of programming languages and the
analysis of concurrent systems. In particular, Triveni integrates the
aforementioned ideas into the context of object oriented programming.
Furthermore, Triveni is compatible with existing threads standards
such as Pthreads and Java threads, and with event models structured on
the Observer pattern [GHJV95]. Finally, Triveni includes
a specification-based testing environment that automates testing of
safety properties.
Next: Triveni: Design and Implementation
Up: Objects and Concurrency in
Previous: Organization of the paper
1998-03-16