Previous: Processor Objects Up: Processor Objects Next: Declaring Processor Object Types

Introduction

A processor object is a collection of data and computation that defines a single address space. Although each processor object is a separate address space in a CC++ computation, each processor object does not have to be located on a physically distinct address space.

This distinction between the virtual address spaces (processor objects) used in specifying the computation and the physical address spaces used to implement it is important. It allows us to separate the problem of defining the computation from the problem of distributing that computation to the available resources. We specify the computation in terms of abstract objects, and then define the mapping from abstract objects to available resources. If the available resources change, we do not have to change the definition of the computation, only the mapping.

As a trivial example, we saw this in the example in Chapter , where we executed


>dist_Hello.out 3 fides hebe fides

This created three Greeter processor objects, two on a machine at Caltech named fides and one on a machine named hebe. If we get another machine, say named rhea, we can execute


>dist_Hello.out 4 fides hebe rhea fides 

without redefining what a Greeter does.

In this chapter we will go through a more complex example: a distributed mergesort. We will explain the syntax behind declaring, defining, allocating, using, and destroying processor objects.

Mergesort can be thought of as a tree of processes, each leaf of which sorts a segment of the array, and each interior node of which merges two branches, eventually resulting in a completely sorted list at the root. Figure shows the interaction of these two types of objects, Merger and Sorter.

After we have defined Merger and Sorter, we can write a mergesort that uses these objects.

paolo@cs.caltech.edu