OSCL Active Object Idioms

Abstract

The ideas presented in this document describe an architecture for organizing  message based client/server threads in an embedded real-time environment. The design goals (principles) outlined below, and target domain (embedded systems) give rise to certain idioms and patterns characteristic of this particular architecture. It is the purpose of this paper to present architectural idiom is based on the application of several principles or heuristics.

Design Principles

This section presents the design principles that drive the decision making process in the design and use of the OSCL active object framework.

Reuse

In keeping with the "reuse-is-king" mantra, the first, and most important principle (design goal) requires achieving a high level of software reuse. This goal is fundamental. Although it may not be necessary for this particular document, the resue is assumed at the source code level.

Exception Reduction

Almost as fundamental, is a desire to minimize the number of functions which can fail by design. The result is a reduction the amount of exception handling code, which simplifies the implementation, reducing the oportunity for errors, and producing a more reliable system.

Clients Supply The Memory

Dynamic data structures built around linked lists are employed throughout the architecture to  the reduce the number of functions that can fail. Heuristics such as "The number of clients supported by a given server shall be limited only by system resource availability" and "The client supplies the memory resources for a transaction" lead the designer toward these data structures. Arrays and other fixed size data structures are used only at the highest levels of the application as a part of configuration. As a general rule, dynamic memory allocation from the global heap is limited to that performed by large grained objects which are instantiated infrequently and generally only at system startup. Run time dynamic allocation is deliberatly limited to implementation by individual servers, which maintain private memory pools and define explicit state driven behavior for exceptional conditions arising from memory allocation failures.

The messages referred to in this paper are like those found in many real-time operating systems environments. The message passing mechanism uses linked list data structures for queueing messages between threads into mailboxes, rather than using ring buffer style messages queues. Ring buffer style message queues have the disadvantage of being of fixed size, which implies that messages sent can fail if the ring buffer queue is full. This is an example of reducing the number of exceptions that can occur at the design level by employing linked lists.