Addressing module implementation

Addressing module implementation
SchemeStation documentation

1 Introduction

The addressing system basically implements a data structure where addressing entries containing (agent specifiers, address) pairs can be stored. The address can be one of

The entries also contain per agent message queues.

The addressing system uses hash table for storing these entries. To ensure effiencient action, hashing is done both ways.

2 Data Structures


Fig. 1 The data structures used int the addressing system implementation

An ActorSpecifier is defined as a 256-bit or 32 char long char array.

A SchedulerID is the local address. It is defined in Scheduler definition.

A RemoteAddress is a struct that includes DomainAddress and an ActorSpecifier valid in that domain. The DomainAddress is specified in Networking Implementation.

An Address consists of an union that can be one of local address (SchedulerID), RemoteAddress, special agent address or external agent address. The latter two are unsigned long integers indices to data structures holding those agents. For the external agents the data structure is the external agent system.

The Address struct also contains enum type that implies the valid field of the union.

An ActorEntry consists of an ActorSpecifier, which is the (unique) key of the data structure, Address that to specifier maps to, the messaging queue, and a bit that indicates whether the agent is blocking (not able to to receive messages).

The AddressingSystem contains an array of null-terminated linked-lists of ActorEntries. The array index is got by counting a hash value from the agent specifier; the hash value can be calculated by simply taking the last n bits of the identifier, since the identifier is supposed to be random. This means that the size of the hash array has to be a power of two, which is reasonable also for performamce reasons (there is no point in extending or shrinking the array by a constant value.)

The entries are also indexed backwards using the address as the hash key. This makes it possible to perform effiecient queries by the address.

3 Functions

In addition to the interface functions defined in Addressing module specification, the addressing system

4.1.14 The functions of module Addressing


File addressing-internal.h

C-functions: