Hardware Reference
In-Depth Information
In addition to out and in , Linda also has a primitive read , which is the same as
in except that it does not remove the tuple from the tuple space. There is also a
primitive eval , which causes its parameters to be evaluated in parallel and the re-
sulting tuple to be deposited in the tuple space. This mechanism can be used to
perform an arbitrary computation. This is how parallel processes are created in
Linda.
A common programming paradigm in Linda is the replicated worker model .
This model is based on the idea of a task bag full of jobs to be done. The main
process starts out by executing a loop containing
out(
′′
task-bag
′′
, job);
in which a different job description is output to the tuple space on each iteration.
Each worker starts out by getting a job-description tuple using
in(
′′
task-bag
′′
, ?job);
which it then carries out. When it is done, it gets another. New work may also be
put into the task bag during execution. In this simple way, work is dynamically di-
vided among the workers, and each worker is kept busy all the time, all with rel-
atively little overhead.
Various implementations of Linda on multicomputer systems exist. In all of
them, a key issue is how to distribute the tuples among the machines and how to
locate them when needed. Various possibilities include broadcasting and direc-
tories. Replication is also an important issue. These points are discussed in Bjorn-
son (1993).
Orca
A somewhat different approach to application-level shared memory on a
multicomputer is to use objects instead of just tuples as the unit of sharing. An ob-
ject consists of internal (hidden) state plus methods for operating on that state. By
not allowing the programmer to access the state directly, many possibilities are
opened to allow sharing over machines that do not have physical shared memory.
One object-based system that gives the illusion of shared memory on
multicomputer systems is Orca (Bal, 1991, Bal et al., 1992, and Bal and Tanen-
baum, 1988). Orca is a traditional programming language (based on Modula 2) to
which two new features have been added: objects and the ability to create new
processes. An Orca object is an abstract data type, analogous to an object in Java
or a package in Ada. It encapsulates internal data structures and user-written meth-
ods, called operations . Objects are passive, that is, they do not contain threads to
which messages can be sent. Instead, processes access an object's internal data by
invoking its methods.
Each Orca method consists of a list of (guard, block-of-statements) pairs. A
guard is a Boolean expression that does not contain any side effects, or the empty
 
Search WWH ::




Custom Search