Inspirel banner

Programming Distributed Systems with YAMI4

11 Special Needs

YAMI4 is a set of communication libraries which design was particularly motivated by the needs of distributed control systems.

What makes control systems somewhat special in comparison to general-purpose or enterprise systems is both the possible environment constraints and the potential criticality of those systems.

Control systems do not necessarily benefit from the comfortable settings of the typical server room with modern and powerful machines ready to offset the overhead of bloated software. In many cases the environment in which the node of the distributed system is running is constrained in the form of some embedded system or system that due to special hardware installation has less memory.

Control systems that are related to critical physical processes or plant management will also have higher requirements with regard to their reliability. The notion of reliability is not even equivalent to the number of possible bugs in the software (although of course that should be kept to the minimum), but rather to the resilience of the system components and their ability to cope with stressful conditions like shortage of memory or interferences with other processes. Even a completely bug-free system can be completely useless if it cannot meet its goals due to its fragility or dependency on other, less reliable components.

Another frequent requirement in control systems is the support for audit and certification, especially in the regulated areas of the industry. These activities are made easier and more effective if they are early addressed by straightforward implementation, strict coding guidelines and clear architecture.

YAMI4 supports the construction of critical systems by virtue of the following properties:

These goals are often conflicting with the expectations of those users who are more feature-oriented and who can afford not to be so strict with all these aspects. In order to accommodate the expectations of different users the YAMI4 library is structured in a way that allows to identify two implementation areas: the core part implementing basic communication services and the general-purpose part that provides more high-level services with easy to use interface.

Just as a reminder, the library structure is explained on the following diagram:

Those users who are particularly interested in the construction of critical systems should focus on the C++ Core library and the Ada Core library - these two components address the concerns identified above.

The small footprint of the core library can be expressed in terms of two values: binary size of the compiled library and the memory usage at run time.

The compiled size of the C++ Core library is in the range of 200kB on a typical Linux system or on the LynxOS system (PowerPC). This size allows to target systems with severe memory constraints or where processes are supposed to be very lightweight so that they can be started very quickly or can exist in big number of instances.

The run-time size of the core library (that is, the amount of memory that is needed for it to work) is extremely small and in essence reflects only the outgoing and incoming message queues. The run-time memory usage can be fixed in terms of private memory partition, as explained in later chapter.

Strict coding guidelines were used in the implementation of the core libraries. In particular, the JSF coding standard was used to a large extent in the C++ Core library to ensure that the code is straightforward and that the mapping between source code and executable code is as obvious as possible.

The strict coding guidelines have a serious impact on how the public interface is structured. In particular, since exceptions are not used for error reporting, the constructors of relevant types never fail and the parts of the initialization process that might possibly fail are extracted to separate init() functions and appropriate error code, of a dedicated enumeration type, is returned to inform about the outcome. In order to avoid confusion, the C++ Core library defines its names in the yami::core namespace. This interface structure is a bit different in the Ada Core library, which shares the parameters container type with its high-level counterpart - apart from this, all core names are defined in the YAMI.Core package.

The minimized dependencies and private memory partitions are explained in the following sections.

11.1 Minimized Dependencies

11.2 Private Memory Partitions