banana slug Embedded Systems and Java at UCSC banana slug


Home Page

Current Projects

Embedding Jini

Java to native compiler

Previous Projects

Java Nanokernel

Embedded Java

Soft-Instructions

Java Network Camera

Other Info

People

Publications

Soft-Instructions

Concurrent system performance, size, and programming tractability is of significant importance in embedded systems. The soft-instruction software architecture can be superior on all 3 counts to both conventional multithreading architectures and to recent synchronous/reactive research approaches.

Concurrent system software consists of such economically important components as OS kernels; file, database, and network systems; device drivers; and I/O, transaction processing, and multimedia servers. Such components are reactive because they continually react to external events such as service requests.

Software architectures are currently of significant interest to the software engineering community. Software architectures provide conceptual integrity to complex systems; they define `a shared repertoire of methods, techniques, patterns and idioms for structuring complex software systems'.

The central feature of the soft-instruction software architecture is a customizable run-time containing a work-loop combining the functions of a machine instruction interpreter with the fundamental functions of an OS kernel. This provides the programmer with 2 levels of atomic instructions; one the actual low-level hardware instruction set; and the other the soft-instruction set specific to the high-level programming problem. The high-level soft-instructions can be interleaved to any required degree, thus supporting concurrent programming without the need for copying the entire register set upon context switch. The entire program is implemented completely in soft-instructions, i.e., if one thinks of an `original' conventional program, this entire program can be considered partitioned completely into critical sections that correspond to soft-instructions. Corresponding to each concurrent service request is a high-level instruction stream context; an arbitrary number of such contexts can concurrently be traversing the single table of `assembled' soft-instructions.

A soft-instruction system implementor has considerable latitude in designing control flow and concurrency soft-instructions custom to his system problem. Soft-instruction implementations are stylized routines which, similar to hardware instructions, have a bounded execution time. Similar to hardware I/O instructions, I/O in a soft-instruction system must be asynchronous, i.e., a soft-instruction cannot initiate actions of arbitrary length.

The soft-instruction programmer thus programs at 2 levels, a programming-in-the-large high-level in which a program is written in a custom instruction set, and a programming-in-the-small low-level in which individual soft-instructions are implemented (often in a conventional language, such as C). Programming-in-the-large can be supported by tools ranging from simple macro assemblers to complex optimizing compilers. Significant advantages of this approach are:

  • Switching between soft-instruction streams uses the same mechanism as that which executes soft-instruction sequences, thus providing featherweight context switches that do not require copying all user registers. This provides superior performance because context switch currently bounds performance of system software, and the current relative cost of copying all user registers upon context switch is increasing.
  • Separation of concerns: Concurrent programming and overall program logic are concentrated in the high-level program, while the low-level soft-instruction implementations concentrate primarily on data structure manipulation. The high-level program source is typically considerably smaller than the low-level source. There is no explicit concurrent C programming in the low-level soft-instruction implementations and thus many traditional concurrent programming problems are eliminated. All program source, both at high and low levels, reflects traditional sequential imperative programming using the imperative instruction model with which system programmers are very familiar.
  • Stack space is factored into long-term and short-term usage. All short-term variables used only for the duration of a single soft-instruction share the same serially-reusable stack, while the context structures corresponding to each concurrent soft-instruction stream contain long-term variables with lifetimes that span the execution of a single soft-instruction. Stack space use is potentially reduced as the single serially-reusable stack is used for all short-term variables for all concurrent soft-instruction streams. This is important when servers expect to support a large number (hundreds) of concurrent requests.
  • Because soft-instructions are deterministic, in principle the implemented programs are easier to analyze when creating hard-real-time programs.

The techniques comprising the soft-instruction software architecture have been used in the past, most notably for real-time avionics software (for instance, the systems controlling the Apollo tracking ships/radars and the 1970's Safeguard missile defense system). Past use suffered from ad-hoc connotations and has been confounded with low-level assembler programming issues, such as variables within a single scope existing on 2 stacks. High level language programming support for this architecture has been limited. Most real-time/concurrent programming research has been directed at replacing such techniques, rather than bring them into the modern software engineering world. Although the use of many of the features of the soft-instruction architecture are supported by results of current synchronous/reactive and light-weight threading research, these current alternative approaches have typically adopted what is the equivalent of a dataflow rather than imperative Von Neumann programming approach. In large systems, such guarded command style programming has proven to be of significant psychological complexity.

To add the soft-instruction architecture to the repertoire of the modern software engineer requires a clear explanation of the distinctive features required of any member of the architecture, a high-level programming model that is `obviously' easy, and a careful formal study of the performance, size, and maintenance characteristics of the architecture. Results of the formal study must be sufficient to provide `back-of-the-envelope' engineering decision support.

Soft-instruction systems are particularly suited to modern embedded applications, since they can run stand-alone with minimal operating system overhead, yet they can scale to support large server applications supporting hundreds of concurrent requests.


Last modified: 06 Feb. 1997
maintained by Charlie McDowell / charlie@cse.ucsc.edu