Вы находитесь на странице: 1из 14

Future Generation Computer Systems 22 (2006) 88–101

A middleware architecture to facilitate distributed programming


DAROC: Data-Activated Replicated Object Communications
Brian M. Stack, Gene Hsiao, Stephen F. Jenks∗
University of California, 444E Engineering Tower, Irvine, CA 92697-2625, USA

Received 6 December 2003; accepted 6 December 2003


Available online 25 December 2004

Abstract

Programming distributed computer systems is difficult because of complexities in addressing remote entities, message han-
dling, and program coupling. As systems grow, scalability becomes critical, as bottlenecks can serialize portions of the system.
When these distributed system aspects are exposed to programmers, code size and complexity grow, as does the fragility of the
system. This paper describes a distributed software architecture and middleware implementation that combines object-based
blackboard-style communications with data-driven and periodic application scheduling to greatly simplify distributed program-
ming while achieving scalable performance. Data-Activated Replication Object Communications (DAROC) allows programmers
to treat shared objects as local variables while providing implicit communications.
© 2004 Elsevier B.V. All rights reserved.

Keywords: Middleware; Distributed system; Data-activated; Blackboard

1. DAROC at a glance in DAROC, programmers are able to simply access


the objects they want without having to be concerned
The Data-Activated Replication Object Communi- with the objects’ locations. Programmers have ac-
cations (DAROC) approach empowers programmers cess to both the data members and the member func-
to be able to write components of distributed sys- tions associated with the object. For example, the
tems without being distributed systems experts, while following simple code fragments show how to ac-
leaving the configuration of mission-critical systems cess a member value in a temperature object in a
to architects educated in design complexities and pit- simulation:
falls of such systems. When writing an application
Data member usage:
∗ Corresponding author. Tel.: +1 949 824 9072; $temperature → current temp;
fax: +1 949 824 3203.
E-mail addresses: stackbr@hotmail.com (B.M. Stack),
Member function usage:
gene@ucsd.edu (G. Hsiao), sjenks@uci.edu (S.F. Jenks). $temperature → convert to celsius( );

0167-739X/$ – see front matter © 2004 Elsevier B.V. All rights reserved.
doi:10.1016/j.future.2003.12.025
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 89

Logic usage: tion of the single-writer rule and activation based on


if($temperature → currrent temp > 100) data changes from data-flow and data-driven systems,
$temperature → current temp = 100. distributed systems issues such as race conditions and
explicit scheduling are eliminated. While the single-
The ‘$’ symbol is used by the DAROC parser to writer rule for data objects (DO) may be seen by some
wrap objects in DAROC code. Code written to use as a significant constraint on expressiveness, it elim-
DAROC is normal C++ code that accesses local vari- inates behavior that limits scalability or would cause
ables and distributed objects in similar ways. The ad- significant confusion or overhead to manage.
dition of the ‘$’ notation tells the DAROC toolkit to Because the application programmers are simply
add code to manage the distributed nature of the object reading and writing data objects, their programs are
without letting that distributed nature affect the pro- logically decoupled from one another through their
grammer. The DAROC middleware handles distribu- interfaces. If timing constraints require tight tempo-
tion of objects and activation of subscribed applications ral coupling between two programs, the system engi-
without any explicit communications or scheduling op- neer can allocate both to the same node, where their
erations in the application code. shared objects are implemented efficiently through
shared memory. If they can execute on separate nodes,
2. Motivation the DAROC runtime system handles object replication
transparently over the network. Neither case requires
Distributed software is normally inherently more any modification to the application program; thus, the
complex than normal, sequential, monolithic software. functional behavior of the programs in the system re-
The complexity arises from local issues, like buffer and mains the same.
concurrency management, to network-centric prob- DAROC borrows the central concept from the black-
lems of naming, addressing, and message passing. Mid- board model, specifically that programs communicate
dleware solutions, like CORBA and others, have been through shared data (objects, in this case) on a logically
developed to abstract or hide some of the communica- shared medium. DAROC differs from conventional
tion details, but the distributed nature of the system is blackboards because of the addition of data-driven
often still exposed and some complexity and overhead activation (or periodic activation, if appropriate to
are generally associated with such approaches. Devel- the application). This eliminates any notion of and
opers must consider aspects such as communications need for a centralized controller and greatly enhances
and scheduling in addition to the functional algorithm the scalability of the system. By pushing scheduling
of the code they are writing. For example, if a middle- decisions out to the local processors and as close to the
ware solution provides a remote procedure call (RPC) distributed programs as feasible, there is no central bot-
mechanism, the developer must choose between block- tleneck. If programs are activated by changes in data,
ing and non-blocking calls, and if non-blocking, worry they will activate on appropriate state changes. If they
about buffer usage and synchronization upon comple- are periodic, they see the current system state on the
tion. If, instead, the communication approach is mes- blackboard when they run. This combination supports
sage based, the programmer must compose the mes- the composition of significant distributed systems.
sage, send it, receive the reply, and decode the reply These specific goals help DAROC reach the overar-
message. All of this work is in addition to the required ching goals below:
implementation of the function the program or module
is intended to perform. • Reduce software development costs, error-
The concepts behind DAROC arose from the goal proneness, and inflexibility associated with distri-
of eliminating the burden of communications and buted systems applications.
scheduling from the application programmer while • Reduce code complexity so that the “average” pro-
maintaining performance and scalability of the sys- grammer is able to build distributed systems.
tem. By giving programmers the view of communicat- • Provide a tool to better prepare students for the ever-
ing through shared objects, very natural interactions growing need in the job market for experienced dis-
between programs are facilitated. With the introduc- tributed systems programmers.
90 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

This is not the first time a solution of this type method and a robust one. Shortly thereafter, many ap-
has been loosely based on the blackboard model plications programs were developed in which the solu-
[14,15,21]. Most blackboard frameworks are not tion space was modeled around the blackboard model.
geared around an object-oriented language, nor have Since applications problems varied greatly along with
they been designed as a distributed middleware solu- the interpretation of the blackboard model, the overall
tion, with a few exceptions, and the majority of these design of each application differed widely.
have complex control components. However, by laying TRICERO [12] is worthy of notice, since it was
down a framework that is based on an object-oriented an early attempt to apply the blackboard model in the
language, uses data-driven activation to eliminate the domain of distributed computing. It used the skeletal
need of complex control structure, and taking the ini- AGE generalization. Its goal was to monitor a region of
tial steps for a future distributed architecture, it does airspace for various aircraft activities and understand
become a unique approach that will provide valuable the signals and fuse together all of the information so
information about the advantages, pitfalls, and overall that it could draw a coherent picture. The problem was
viability of such a solution. partitioned into independent subproblems and various
The need for DAROC arose from the experience blackboard systems perform the computations.
of one of the authors while designing distributed The backboard model of problem solving has not
avionics architectures for next-generation aircraft. This undergone any substantial changes in the last three
led to blackboard-style designs for avionics architec- decades. Nii [19] points out that the term “blackboard”
tures [9,11]. These prior systems did not have the appeared in the Artificial Intelligence literature in 1962
object-oriented nature of DAROC, nor did they ad- when Newell was concerned with the problems of
dress shared-memory multiprocessor nodes within dis- programs organized along a generate-and-test search
tributed systems. That author’s research into functional model. Such programs were restricted in their data ac-
language compilation and multithreaded architectures cess and had inflexible control posed by traditional pro-
[10] led to the functional programming and data-driven gram structures. Newell realized that maintaining the
activation paradigms of DAROC and the previous de- isolation of specific routines, but allowing all the sub-
signs. A non-distributed prototype implementation of routines to make use of a common data structure, could
the DAROC middleware was shown in [22]. alleviate the difficulties. Newell used the blackboard
metaphor to describe such a system as follows.
3. Background Metaphorically, we can think of a set of workers,
all looking at the same blackboard: each is able to read
Historically, the blackboard model arose from ab- everything that is on it, and to judge when he has some-
stracting features of the HEARSAY-II [7] speech un- thing worthwhile to add to it. This conception is just
derstanding system, which was developed around 1971 that of Selfridge’s Pandemonium [20]: a set of demons,
and finished around 1976. The HEARSAY-II project each independently looking at the total situation and
is considered the most influential on the development shrieking in proportion to what they see that fits their
of the blackboard model. HEARSAY-II was a project natures [17].
under the DARPA Speech Understanding Project that A significant number of non-trivial applications
started in 1971. The Speech Understanding Project goal and frameworks have been built around the black-
was to design and implement a system that accepted board model. Some projects of note are the PROTEAN
continuous speech from cooperative speakers that were project, which is a knowledge-based system that uses
issuing commands in a quiet room with a good quality the framework provided by BB1 [6–8]. It derives three-
microphone. HEARSAY-II, in particular, was able to dimensional conformations of proteins in solution from
answer queries about computer science abstracts stored empirical constraints derived from magnetic resonance
in a database. HEARSAY-II is important because it is data. General BlackBoard (GBB) [4,5] is a generic de-
noted as being the first true blackboard system. velopment system that provides an efficient and well-
The HASP project is another example of a black- structured blackboard that can be made available to a
board system [18], which added even more credibil- “blackboard administrator” for the implementation and
ity that the blackboard was a general problem-solving maintenance of high-performance applications.
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 91

One hot topic within the IT community that is ag- the functional elements (FEs) can exploit in an object-
gressively being pursued is that of audio mining via oriented fashion. However, with DAROC, functional
audio search engines [16]. These speech engines offer elements do not know anything about the identities of
speech processing and search technologies in a single other functional elements and do not have to. There is
package. The search engine usually creates an index no such thing as a functional element communicating
that includes a time and date stamp for each spoken directly with another functional element. The inverse
word. The search engine then uses the index to allow is the object-oriented style where objects must know
rapid identification and playback of the requested mes- each other’s identities in order to take advantage of
sage. Meta-tags may also be placed on the data to iden- the objects’ data and operations. The implicit invoca-
tify the speaker, subject, or tone of the messages. This tion also has its influence in DAROC. DAROC uses
new software breakthrough is being touted for indexing a data-activation approach to activate functional ele-
uses ranging from corporate meetings to training videos ments, which cause functional elements to be implic-
and even for help desk conversations. Companies such itly activated, based on changes to data object states
as ScanSoft in Boston, Fast-Talk Communications in or periodic changes. Like implicit invocation, DAROC
Atlanta, and BBN Technologies in Cambridge, MA, components can be very heterogeneous and lend them-
are all major players in this market who have an ap- selves to reusability in a variety of contexts. However,
plication either built or influenced by the blackboard DAROC, unlike other pure implicit invocation styles,
model and are currently penetrating the commercial has knowledge of what components will respond to an
marketplace. event, which in DAROC refers to updates to a data ob-
ject. DAROC uses subscription lists that are used to
3.1. The blackboard as the style of choice link functional element to data objects.
Therefore, while DAROC is primarily based around
The blackboard style’s simplicity is a big advantage the blackboard style, in reality, like the vast majority of
over other widely accepted architectural styles. The systems built, it is heterogeneous in nature, combining
blackboard style consists of one connector that all com- some parts of the blackboard, implicit invocation, and
ponents use, which of course is the blackboard itself. object-oriented styles as part of its architecture.
Other blackboard advantages are flexibility and ability
to evolve, because new types of components can be eas-
ily written. A system based on CORBA [3] or JINI [2], 4. DAROC as a middleware solution
on the other hand, uses a client/server style that requires
programmers to design unique interfaces for every new DAROC exposes two architectural components to
component that is generated. Since the DAROC black- programmers: functional elements are active and per-
board style consists of only the blackboard interface form computations and analyze the system state, while
and very simple scheduling mechanisms, components data objects that make up the communication method
are simple to compose and integrate. between FEs and notionally reside on the black-
The blackboard style naturally lends itself to concur- board. Unlike functional elements, data objects are
rency. Multiple components can read and write black- passive and do not perform computations. DOs are
board data and perform their assigned computations strongly typed data objects, ostensibly defined with an
concurrently, whereas styles such as pipe and filter or architecture- and programming language-independent
layered systems are often serial in nature. These styles description, but for this prototype, normal C++ objects
consume their inputs, perform their computation, and are used. The prototype requires that DOs are contigu-
then send their results to the next component or layer. ous data structures (no pointers, for example) for sim-
Also, pipe and filter and layered system styles are not plicity, because of the difficultly in transferring linked
nearly as flexible as the blackboard style and may have objects between different address spaces. Eventually,
scalability issues associated with them. with the addition of packing methods, complex non-
The DAROC architecture was partially influenced contiguous objects can be supported.
by the object-oriented approach, in that DAROC data Functional elements are the active entities in a
objects consist of data and associated operations that DAROC system and compose the distributed applica-
92 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

tion software. The scheduling of FEs is managed by error recovery code is fraught with potential errors
the middleware, and FEs are not designed to be contin- and is often difficult to test.
uously running programs, but programs that are acti-
vated when needed, at which point, they perform their With the simplicity provided by local variable-
function and then deactivate until the next time they are style access to transparently distributed DOs and
needed. There is no limit to the size and complexity of the functional nature of FEs, DAROC’s features
an FE. FEs can be as small as a simple data transfor- appeal to application programmers, just as the
mation, as large as a compiler, as complex as a target above distributed system features appeal to system
tracking correlation filter or a graphics engine to draw architects.
system status displays. Details of FE activation are pro-
vided below. 4.1. DAROC’s distributed object space
FEs get their name because they are intended
to be functional (in the mathematical sense) pro- While DOs appear to be local objects to the code
gram components. This means that FEs should com- in an FE, DOs are uniquely identified by name in the
pute their results based on their inputs (DOs on the global system space. In the current prototype, DOs are
blackboard) and produce results to be stored in DOs referenced using a single-level global naming scheme,
on the blackboard. While it is not enforced, ideal but DAROC’s goal is to utilize a robust hierarchical
DOs should not store state internally, but should one. The goal is to combine a set of FEs along with the
store state in DOs on the blackboard. These guide- DOs they advertise as external interfaces and the inter-
lines provide some very valuable features to DAROC nal DOs used to store state and communicate between
systems: the FEs as a modular component that can be reused
between projects and simply inserted into systems as
1. Since the system state is stored on the blackboard needed. The blackboard does not distinguish between
and FEs do not store internal state, debugging is sim- DOs used within a component group and DO used to
plified. Developers can monitor and record the sys- communicate between components. Instead, the nam-
tem state unobtrusively by retrieving DOs of interest ing scheme separates the two. Since DOs are referenced
from the blackboard. In addition, the FE should re- by name when they are created or opened, FEs from one
turn identical results each time it is activated with a component group will tend to only access DOs that are
specific set of inputs. Therefore, the functional cor- explicitly defined as external interfaces by other com-
rectness of the FE can be debugged independently ponents. At this moment, there is nothing to prevent
of the running system using test generators to stub an FE from opening an “internal” DO from another
out the rest of the system. component, but internal interfaces may change more
2. Fault detection and recovery can also be facilitated frequently and with less documentation than external
by taking periodic snapshots of the blackboard. ones, so doing so may invite trouble. Safeguards to pre-
In non-real-time simulations, these snapshots can vent unauthorized access to objects may be added in the
be used to restart a system after node failures. In future if needed.
embedded systems experiencing software failures, The distributed object space of DAROC allows DOs
these snapshots can be used to replay the state of to be read by any number of FEs, but each DO can only
the system in the lab to help maintainers duplicate, be written by a single FE. This is known in DAROC
identify, isolate, and repair the faulty code. as the single-writer rule. By using a single-writer
3. If the DAROC middleware enforces replication of rule as part of a programmer’s implementation of the
all DOs on more than one node, recovery from a distributed system, we are able to easily eliminate race
node failure can be performed transparently. The conditions, ambiguity problems, and complex locking
FEs that were on the failed node can be restarted mechanisms found in other distributed solutions
on another node, and using their most recent state that allow shared-write access to data. While the
and input DOs from the blackboard can achieve the single-write rule initially seems like a significant
proper results without any recovery code written restriction to application programmers, we found that
by the FE programmer. This is compelling because programmers quickly adapt because of the simplicity of
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 93

the rule. In addition, almost any situations that “need” consistent no matter the placement. Section 4.3 de-
multiple writers to a single shared object can use a mod- scribes the distributed object transfer mechanism in
erator object to accept inputs from the multiple writer detail.
FEs and then pass the appropriate value on to the desti-
nation DO. This approach is very scalable and does not 4.2. DAROC’s FE Activation Cycle
require global locking or other expensive synchroni-
zation. A significant design constraint of DAROC is to
DAROC data objects can be of arbitrarily complex make scheduling of FEs both simple and scalable. This
data types. All the simple data types are currently sup- is accomplished through activation when input data
ported such as integers, doubles, and characters, as changes (data-activation) or as time changes (periodic
are structured abstract data types, arrays, and combi- activation). Many early systems built using the black-
nations thereof. The only limitation currently is that board model used a very complex control component
all data objects that the user creates must be contigu- for scheduling and activating the knowledge sources,
ous storage type objects. At this point, linked lists, as they where called, which performed a computation
trees, and other non-contiguous data types are not sup- or analyzed the state of the blackboard. This added
ported. A wrapper method to pack and unpack these control mechanism made blackboard implementations
object types could be added to provide support in future complicated and, sometimes, fragile, because the con-
revisions. troller needed to understand the behavior of the system
DOs are referenced within FE code using normal in order to schedule it. This also limited scalability by
object pointers. The DAROC middleware creates and making the controller a bottleneck. In DAROC, activa-
manages the space for an FE’s DOs, so the FE can tion of FEs is the result of changes to input data objects
simply access them as local objects. DAROC guaran- specified by the application programmer. DAROC also
tees the consistency of all DOs in use by an FE while allows for the activation of functional elements on a
the FE is in its execution cycle (see below). When the periodic basis. Since DAROC guarantees that all data
FE is not executing, DOs written by other FEs are up- object updates are atomic from the consumer’s view-
dated atomically, so no FE sees a partial update to point, once a functional element is activated, the data
a DO. In addition, different FEs may have be using object it uses will remain unchanged and accessible to
different instances of common DOs. For example, if it. The functional element performs its work, computes
one FE has a long execution cycle, it will use the in- its results, and finishes and waits for the next time it is
stances of its DOs that were current when its execu- activated.
tion cycle began. Other FEs that start later may see Every functional element is created as a single
more recent instances of those same DOs. When an POSIX thread, which controls the functional element
FE completes an execution cycle, DAROC automati- payload. The functional element consists of wrapper
cally provides the current instance of DOs written by code generated by the DAROC toolset to manage DOs
that FE to other FEs that want them. By guarantee- and the application function written by the program-
ing consistency during execution, DAROC provides a mer to perform the work of the FE. Fig. 1 shows a
simple, natural, expected behavior model to application typical Activation Cycle for any generic functional
programmers. element.
The transfer of DOs between nodes is handled au- Data objects are read and written by the FEs in the
tomatically by the DAROC middleware. Application system as often as needed. A handler associated with
FEs are not aware of whether the source of any DO each FE checks the specified set of data objects needed
they use is local or remote, so DAROC provides lo- by the FE to perform its computation. When the han-
cation transparency. Since all communication is done dler notices a new instance of any of the DOs in its
through named data objects, the distributed nature of set, it enters a verification phase. In this phase, the FE
the system is hidden from application programmers. handler first determines which data object has changed,
Systems engineers can assign FEs to the same node and then checks if any other DOs in its set have been
for performance or other considerations, but the code updated since the last time it activated the FE’s appli-
does not change and the logical behavior remains cation function. The normal activation condition in the
94 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

Fig. 1. FE Activation Cycle state diagram.

prototype is the “AND” condition, so if all DOs in the 4.3. Distributed object transfer
handler’s set have changed, the FE handler will pass
control to the application function that performs the Location-transparent implicit DO transfer between
work of the FE. While the AND activation condition is distributed system nodes is provided by DAROC.
the default, OR conditions or more complex Boolean A Name Server, written in Python, allows the FE
or state-machine operations are just as easily possi- handlers to look up the “home node” of any data
ble (complex conditions were not implemented for this object. The handlers can then query the home node for
prototype to avoid the complexity of how to specify each DO they need to determine the status of the DO.
them in a language-independent manner). For example, Fig. 2a shows how an FE handler looks up the source
the user may want to activate the FE every third update
to an input DO; rather than embedding that logic into
the application, it is better to specify it as an activation
condition in order to keep the functionality separate
from scheduling concerns. If the activation criteria are
not met, the handler will wait until it detects further
change in its DO set.
Inside the user application function, the user code
operates on the latest instances of the DOs in its com-
putational set. In the current prototype, these instances
are local copies made from the writer FEs’ original
objects. The handler stores these copies in the buffer
labeled FEBAR in Fig. 1 right before the application
function is started. Some of these copies are not really
needed for infrequently modified objects, so copy-on-
write and/or multiple buffer management with usage
counting will improve the efficiency in future revisions.
Once the application function finishes its computation,
control returns to the FE handler, which propagates up-
Fig. 2. Distributed object: (a) check in/lookup and (b) transfer re-
dated DO instances to the blackboard. quest.
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 95

information for a DO from the Name Server. Fig. 2b 4.4. The DAROC toolkit
shows an FE handler requesting an updated DO
instance. The response message will either contain the The DAROC middleware provides network trans-
new instance or notification that the DO has not been parency and a programming paradigm in which all
updated. accesses to data objects appear as local accesses.
Because current implementation of DAROC is an However, in order to facilitate the initial design
experimental prototype, we are still evaluating the best goal of simplifying distributed programming so that
update method to use for DO transfers. As of this writ- the “average” programmer can easily and rapidly
ing, a “pull” approach is used, where the FE handlers begin writing distributed applications, a set of tools
contact home nodes of DOs to determine if they have will simplify code development. The tools will aid
been updated. The DAROC middleware on those nodes application developers by automatically generating
will then either respond with the updated DO instance wrapper/handler code to manage DO transfers and FE
or notification that no change has occurred since the last activation. Other tools build FE prototype code and
time the FE received the DO (all instances are times- verify the consistency of the blackboard.
tamped or otherwise uniquely identified when written The current toolkit contains three main components.
to allow such checks). This approach is bandwidth con- The first component is the DAROC parser. All FE ap-
servative, because it prevents unnecessary DO trans- plication source code is first run through this parser be-
fers (to FEs that are not ready for the update), but it fore it is compiled. The parser automatically wraps the
also has some overhead and latency due to the queries. referenced data objects with the appropriate DAROC
We are evaluating a “push” approach where updated code and casts the data objects to their corresponding
DO instances are automatically transferred to nodes data types. This parser interprets names prefixed with
containing FEs that use those DOs. This will enhance a ‘$’ symbol, as shown in a previous example, as DOs
scalability by making all update checks local, but may to be managed by the middleware. It then matches the
increase network utilization due to excessive updates to DO name with the used specified class/type and gen-
rapidly changing DOs. We are investigating throttling erates the code to support DO access and transfer as
approaches based on the activation patterns of FEs that well as FE activation. The long-term goal of this por-
use such DOs, though fault tolerance may be hurt by tion of the toolkit is to make DO type definitions use
this (see below). an architecture- and language-independent specifica-
The automatic transfer of DO instances to nodes tion in order to support heterogeneous nodes. The tool
that use them means that the “current” instance of a will be able to generate code to translate between for-
DO may reside on more than one node. This natural mats and orderings within the system.
replication mechanism provides a simple redundancy The second component is the single-writer rule
approach that can be used to recover from node failures. checker. The single-writer rule is a main part of the
If the replication is enforced so that all DOs exist on at initial DAROC architecture. The single-writer rule
least two nodes, then recovery from failure of one of checker will examine user application code and warn
the nodes can occur without any explicit recovery pro- the programmer of any code segments, which could
gramming from the user (assuming the FEs are indeed possibly violate the single-writer rule. For the proto-
functional and store any state as DOs on the black- type, we chose to implement this rule checker as part of
board). The FEs from the failed node can be restarted the toolset rather than part of the middleware to reduce
on other nodes (either cold, warm, or hot spares), while overhead. We will re-evaluate this decision as needs
their input (and state) DOs can be retrieved from wher- arise, but certainly the Name Server component could
ever they reside. The middleware can then reassign the be used to perform this check at run time.
identify of the writer node of the DOs written by the The third toolkit component is the DAROC nugget
restarted FEs to the new node(s) where they reside. This code creator. All DOs and FEs the user creates can
functionality has not been completely implemented in be derived from a standard code template generated
the current DAROC prototype, but many pieces are by this tool. That is to say, simple data objects are
in place. The forced replication is not done because it created by initializing there private members and
likely needs the “push” transfer model described above. calling DAROC’s data object constructor and simple
96 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

Fig. 3. DAROC Tool Kit Functional Element Code Nugget Form.

functional elements are created with a similar method pieces into the appropriate segments of the applica-
with the addition of the user FE application function tion.
which is added. Both data objects and functional The DAROC nugget code generator will be valid
elements also have their standard lists of which entities for simple functional elements and data objects, such
they need to communicate with. The DAROC nugget as ones with small subscription lists and those without
code generator will allow programmers in practical special user-defined member functions. Later improve-
terms to fill out a “form” for a simple data object or ments to the component should make it more scalable to
functional element as shown in Fig. 3. For example, a wider range of data objects and functional elements.
in the functional element form, the programmer will
enter things like the name of the FE, its type, does it
have a periodic activation or is it based on specific data 5. Results and analysis
objects. Also the programmer will enter how many
data objects it can read or write too and the names DAROC has the seemingly competing goals of mak-
of these objects, respectively. They can then simply ing distributed application programming easier while
click a button and have the code generated for them, maintaining scalability and reasonable performance.
with no missing commas, parentheses, or other similar As the results below show, DAROC simplifies pro-
syntactical programming errors that so often occur. gramming by requiring much less application code than
The code nugget will be generated in a separate file, competitive approaches. Performance test results also
so it will be up to the programmer to inject the code show that even in its unoptimized state, the current
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 97

prototype supports thousands of activations/object duction would vastly increase the speed at which the
transfers per second using shared memory. application could be up and running.
To get a baseline evaluation of how DAROC can
make distributed programming easier, we examined 5.1. Single node throughput measurement
how JINI and JavaSpaces [1] from SUN Microsystems
expedite distributed programming for the programmer. A small system of two functional elements and
Fig. 4 shows a comparison of how JINI, JavaSpaces, four data objects were used to measure the through-
and DAROC stacked up in the number of lines of code put in terms of object update operations followed by
and number of characters to implement components of FE activations. These measurements were performed
a smart refrigerator demo that was written in DAROC. on an Intel 810 Chipset, 1.1 GHz Celeron processor
The smart refrigerator simulation was written using and 384 MB of memory running Mandrake Linux 9.0.
DAROC in order to give a visual projection of how Roughly two dozen simulations were performed, which
functional elements work and how they interact with where based on average data object sizes ranging from
their respective data objects. A week of random re- less than 500 bytes up to 1,000,000 bytes and total
frigerator use was simulated. An inventory check, a activations which ranged from 500 to 1,000,000 (the
shopping list, numerous food scales, along with vari- total number of activations for the system is achieved
ous temperature and mechanical controllers, were also by the addition of the two functional elements total
simulated. As Fig. 4 illustrates, JINI is a very heavy so- activations). Fig. 5 shows the results of these exper-
lution and takes considerably more lines of code then iments. It is important to keep in mind these num-
either JavaSpaces or DAROC. JavaSpaces has a 10% bers are strongly tied to the underlying hardware of
overhead compared to DAROC when looking only at the system, particularly the CPU speed and memory
the number of lines of code. bandwidth.
However, when you examine the complexity of each In Fig. 5, an analysis of how long it takes for the
line of code in terms of the number of characters, which two functional elements using various average sized
we make the reasonable assumption that if a line of data objects to perform the specified number of activa-
code has half as many characters as another line of tions is shown. The figure shows that if the average data
code, then it is also proportionally less complex. It is object is under 10 KB, then DAROC can perform hun-
observed that DAROC overall takes about 22% less dreds to tens-of-thousands of activations in less than
characters to produce the same results. At face value, 1 s. Hundreds-of-thousands to millions of activations
this does not seem all that striking. can be performed in a matter of seconds as long as
But if we were coding a realistic real world appli- the average data object size stays under 1 KB. When
cation with tens-of-thousands of lines of code made up more than hundreds-of-thousands of activations occur
hundreds-of-thousands of characters, then that 22% re- or data objects greater than 10 KB are simulated, then

Fig. 4. Analysis of three data objects and three functional elements from the smart appliance demo.
98 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

Fig. 5. Single node activation performance.

a linear increase in processing time occurs due to the dled by the DAROC-supplied handler rather than by
PC’s hardware limitations. the application function. While some of the code in the
handlers is more general than code written for a single,
5.2. Distributed transfers specific application, the overhead is very small, partic-
ularly on modern processors. The message traffic in this
The DAROC prototype supports distributed DO simple case is the same request/response message pairs
transfers correctly, but because of the way it is imple- as would be needed by a hand-coded communication
mented, it is difficult to get accurate measurements of application. DAROC is intended to have similar perfor-
activations run per second or transfers per second. The mance to hand-coded alternatives, but with less vari-
issues do not affect functionality, but currently, at least ability, because DAROC uses a consistent approach to
one of the FEs that writes a DO drive the data-driven object transfers. On the other hand, DAROC (and other
FEs in the system must be periodic. Thus, a full-speed general middleware solutions) may not take advantage
feedback loop-style pair of FEs, which could be used of application-specific optimizations that a clever pro-
to measure activations per second, will not work with grammer could fathom. This seems a fair trade, given
the current code. While possible fixes to this issue are the complexity and fragility of distributed system pro-
being evaluated, we will analyze the process of activa- gramming.
tion and transfer in a simple FE pair to show that the
DAROC architecture is not, by nature, significantly less 5.3. Function point analysis
efficient even than hand-coded message passing.
Fig. 6 shows a pair of interacting FEs that may run on Function points are a unit of measure for software
different nodes or the same node without any change to much like an hour is a measurement of time, miles are to
the application code. Both FEs use both the “hello” DO measuring distance, or Celsius is to measuring temper-
and the “world” DO as input. When both have changed, ature. Function points are an ordinal measure much like
each FE prints “helloworld” to the screen in its user- other measures such as kilometers, Fahrenheit, hours,
written application function. FEhello writes the “hello” etc. [13].
DO and FEworld writes the “world” DO. The diagram Function points measure software by quantifying its
shows that all the activities involved with requesting functionality provided to the user based primarily on
updated DOs and sending and receiving them are han- the logical design. Frequently, the term ‘end user’ or
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 99

Fig. 6. Two FEs interact through DO transfer.

‘user’ is used without specifying what is meant. In this with other metrics. The VAF for a DAROC and JavaS-
case, the user is a sophisticated user that is someone paces will be the same, since the general functionality
that would understand the system from a functional per- of both is similar. In addition, the analysis only takes
spective who is more than likely someone that would a subset of the functionality of the system for its com-
provide requirements or does acceptance testing [13]. parison. Therefore, the VAF will not be used in the
There are a variety of different methods used to analysis. So we are left with an analysis calculation of
count function points, but this analysis is based upon AFPB = UAF.
those rules developed by Alan Albrecht and later re- A UAF calculation is based on fives types of com-
vised by the International Function Point User Group ponents. These components are:
(IFPUG). There are varying types of function point
• External Inputs (EI)—an elementary process in
analysis that can be performed depending on the anal-
which data cross the boundary from outside to in-
ysis you want to extract and the stage of the project.
side;
The types of function point calculations that exist are:
• External Outputs (EO)—an elementary process in
• development project function point; which derived data pass across the boundary from
• enhancement project function point; inside to outside;
• application after enhancement project; • External Inquiry (EQ)—an elementary process with
• application function point baseline count. both input and output components that result in data
retrieval from one or more Internal Logical Files and
The analysis that is performed on DAROC and
External Interface Files;
JavaSpaces is an application function point baseline
• Internal Logical Files (ILF)—a user identifiable
count (AFPB). The AFPB = ADD × VAF, where ADD
group of logically related data that resides entirely
is the unadjusted function point (UAF) count of those
within the application boundary and is maintained
functions that were added by the enhancements and
through External Input;
VAF is the value adjusted factor. Therefore, our calcu-
• External Interface Files (EIF)—a user identifiable
lation is AFPB = UAF × VAF. The analysis is based on
group of logically related data that is used for refer-
code from the smart appliance demo. The DOs and FEs
ence purposes only.
for the demo were analyzed, but the graphical front end,
which was built with the GTK+ graphics libraries, was All of these components are rated as being low, av-
not analyzed. VAF is based on 14 general system char- erage, or high; this rating is based on the number of
acteristics. The VAF measurements are becoming less data element types (DET) that they reference. A DET
frequently used by organizations involved with func- is a unique user recognizable non-recursive field. Since
tion point analysis. Instead, many are using the UAF the data sets in the smart appliance demo are small, all
100 B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101

Table 1 makes distributed application programming easier for


Function points complexity comparison people who are not distributed systems experts. Be-
Type of component JavaSpaces DAROC cause DAROC provides location transparent access
External Input 10 × 3 = 30 3×3=9 to “shared” data objects residing on a distributed vir-
External Output 8 × 4 = 32 4 × 4 = 16 tual blackboard, no explicit communications code is
External Inquiries 20 × 3 = 60 17 × 3 = 51 required in applications. Because applications can be
Internal Logical Files 15 × 7 = 105 15 × 7 = 105
External Logical Files 0×5=0 0×5=0
activated by changes in the data objects they use or pe-
riodically, scheduling is likewise eliminated from the
Total UAF 227 181
applications. Analysis of programs written for DAROC
demonstrates a reduction in lines of code by 10–40%
and a reduction in code complexity based on function
components are rated at the low complexity level. A point analysis by 25% when compared to other two
DET can be viewed as the data in a data object in mainstream distributed programming environments.
DAROC or entry in JavaSpaces. Table 1 shows the com- We have shown that the middleware can automati-
putation of component complexity for JavaSpaces and cally transfer data objects between the nodes containing
DAROC. The numbers in bold are static and are the the programs that write the objects and nodes running
set values when performing an analysis of a low com- programs that use the objects. This automatic replica-
plexity level component. The italic numbers are the tion, combined with simple software implementation
total number of instances that type of component oc- rules, lends itself to a fault tolerance model in which
curred in the respective implementation of the various programs from failed nodes can be restarted from their
data objects and functional elements in either DAROC replicated state objects. Our data transfer and activa-
or JavaSpaces. This analysis reveals that DAROC has tion experiments show that, while there are some inef-
a reduction in the number of explicit inputs, outputs, ficiencies in the current prototype, single node perfor-
inquires, and Internal Logical File components the pro- mance is good and multi-node performance is reason-
grammer uses by a factor of 25.4%. able. The middleware is doing network operations like
those that explicitly coded distributed software would
do, but it is doing it in a consistent manner. Evalua-
6. Continuing research tion of the scalability of alternate communication im-
plementations within the middleware is ongoing. The
Future revisions of DAROC over the next few years evolving tool kit will also enhance the programmability
will continue to add system improvements such as com- of this simple, yet powerful distributed programming
plex data objects, grid support, dynamic configuration environment.
capabilities, and legacy encapsulation. The short-term
goal of DAROC is to provide an educational tool to
better teach distributed systems. The long-term goal is References
for DAROC to address problems such as distributed
[1] JavaSpaces Service Specification, Version 1.1, Sun Microsys-
simulations and battle management scenarios. tems, 2000, p. 20.
[2] Jini Network Technology, http://wwws.sun.com/software/
jini/whitepapers/jini-datasheet0601.pdf, 2001.
7. Conclusion [3] CORBA 2.6.1 Specification, http://www.omg.org/technology/
documents/formal/corba 2.htm, 2002.
[4] D.D. Corkill, Blackboard systems, AI Expert 6 (9) (1991)
Current distributed programming paradigms force 40–47.
programmers to write communication and scheduling [5] K. Decker, A. Garvey, M. Humphrey, et al., Parallel Blackboard
code into their application code. This leads to unread- System, University of Massachusetts Technical Report 90-54,
able code, complex and hidden coupling and depen- 1992.
[6] B. Hayes-Roth, BB1: An Architecture for Blackboard Sys-
dences between programs, and makes the programs tems that Control, Explain, and Learn About Their Own
more difficult to develop and maintain. We have shown Behavior, Stanford University Technical Report HPP-84-16,
that the DAROC data-activated middleware approach 1984.
B.M. Stack et al. / Future Generation Computer Systems 22 (2006) 88–101 101

[7] B. Hayes-Roth, A blackboard architecture for control, Artif. tional Conference on Parallel and Distributed Processing Tech-
Intell. 26 (3) (1985) 251–321. niques and Applications, Las Vegas, 2003.
[8] B. Hayes-Roth, K. Pfleger, An Introduction to Blackboard-Style
Systems Organization, Stanford University Technical Report
KSL-98-03, 1998. Brian M. Stack received his BS degree in
[9] S. Jenks, T. Domae, A blackboard approach to advanced avion- Electrical and Computer Systems Engineer-
ics systems, in: Proceedings of the 1994 Society of Naval En- ing from Rensselaer Polytechnic Institute in
gineers Conference, Indianapolis, IN, 1994. 1998. He worked extensively as an operat-
[10] S. Jenks, J-L. Gaudiot, Nomadic threads: a migrating multi- ing system and security expert at Lockheed
threaded approach to remote memory accesses in multiproces- Martin for 3 years. He was then awarded
sors, in: Proceedings of the 1996 Conference on Parallel Archi- a fellowship and worked as an RA at the
tectures and Compilation Techniques (PACT’96), Boston, MA, University of California at Irvine where he
1996. completed his MS in computer network and
[11] S.F. Jenks, H.L. Logan, Towards a more affordable avionics pro- distributed system in June of 2003. He cur-
cessing architecture, in: Proceedings of the National Avionics rently is a distributed systems architect as
Conference, San Antonio, TX, 1993. Northrop Grumman. His interests include distributed systems, secu-
[12] F. Londono, A blackboard framework to support concurrent rity, and the future of open-source technology as a viable business
engineering, Ph.D. Thesis, West Virginia University, 1990. model.
[13] D. Longstreet, Function Points Analysis Training Course, revi-
sion August 2002, http://www.softwaremetrics.com/. Gene Hsiao is an undergraduate researcher
[14] J.W. Mcmanus, Design and analysis techniques for concur- in electrical engineering and computer sci-
rent blackboard systems, Ph.D. Thesis, College of William and ence at University of California, Irvine. His
Mary, 1992. current research interests are in parallel and
[15] J.W. Mcmanus, J.A. Kaplan, W.L. Bynum, Automated Concur- distributed computing, and computational
rent Blackboard System Generation in C++, Langley Research science. He is a member of the ACM, Eta
Center NASA Technical Document NASA/TM-1999-209128, Kappa Nu, the IEEE Computer Society, and
1999. Tau Beta Pi.
[16] R.L. Mitchell, Search engines break the sound barrier, in: Com-
puterWorld Magazine, 2002.
[17] A. Newell, Some problems of the basic organization in problem-
solving programs, in: Proceedings of the Second Conference on Stephen F. Jenks received the BS degree
Self-Organizing Systems, 1962. from Carnegie Mellon University in 1987
[18] H.P. Nii, Blackboard application systems and a knowledge en- and the MS and PhD degrees from the Uni-
gineering perspective, AI Mag. (1986) 82–107. versity of Southern California in 1992 and
[19] H.P. Nii, The blackboard model of problem solving and the 2000, respectively. He designed advanced
evolution of blackboard architectures, AI Mag. 7 (3) (1986) avionics and medical systems for 14 years at
38–53. Northrop Grumman Corporation. He is cur-
[20] O. Selfridge, Pandemonium: a paradigm for learning, in: Pro- rently an assistant professor in the Depart-
ceedings of the Symposium on the Mechanization of Thought ment of Electrical Engineering and Com-
Processes, HMSO, London, 1959. puter Science at the University of Califor-
[21] C. Spruit, Blackboard systems in SOCCA: process evolution vi- nia, Irvine. His research interests include
sualized by reproductive, communicating blackboard systems, parallel and distributed computing. He is a member of ACM and
M.S. Thesis, Leiden University, 1997. the IEEE Computer Society.
[22] B.M. Stack, S.F. Jenks, A middleware architecture to facilitate
distributed programming, in: Proceedings of the 2003 Interna-

Вам также может понравиться