Next: Compiling and running programs Up: Implementation Previous: Handling C++

Porting C-with-Ease

 

The C-with-Ease implementation can be easily ported to various parallel architectures by providing an appropriate host interface. The host model is described in section 5.1.

Host Interface

The host interface handles all of the low level access to the host, including thread creation and switching, semaphore and mutex functionality and message sending and receiving.

Typically, a host interface consists of a small header file containing definitions of the host characteristics for the Ease library, and another defining the necessary functions. The header file specifies whether it has multiple cells, whether the host has threads, and if those threads are preemptive. It also defines the types for a cell identifier and a thread identifier.

Basic interface

 

The following functions should be supplied:

Thread Handling Interface

A host interface must either define the macro NTHREAD (for no threads) or supply the following functions and types:

The interface specifies that threads are preemptive by defining the macro PREEMPT. For non-preemptive threads, the following function must be supplied:

For preemptive threads, the following types and functions must be supplied:

Message Passing Interface

A host type that uses message passing should define the macro _EASE_MULTI. It should supply the following types and functions:

Next: Compiling and running programs Up: Implementation Previous: Handling C++



Tim MacKenzie <tym@cs.monash.edu.au>
Mon Apr 1 00:27:29 EST 1996