The Weaves framework creates a new language independent abstraction for object-based composition of unmodified code modules. The main motivation forWeaves stems from the lack of a programming model that provides transparent support for namespaces. The two major programming models processes and threads can be considered extremes along a sharing axis. Multiple threads through a process share all global state whereas instances of a process (or independent processes) share no global state. Weaves provides the generalized framework that allows selective sharing of state between multiple control flows (called strings) through a process. In effect, Weaves enables application composers to transparently create multiple namespaces (called weaves) with selective sharing of state between namespaces within a single address space.
The salient features of theWeaves framework are: (1) It can create multiple instantiations (called beads) of code modules similar in principle to OOP’s objects and classes. Applications can be created by object composition. Since the framework is source language-independent, practically any code-base can be weaved. (2) It supports transparent checkpointing and recovery without any application support. Checkpointing and recovery uses a very efficient optimistic algorithm based on run-time analysis, that in most cases is better than application specific hand-coded checkpointing. (3) It provides strong support for run-time adaptation temporally through fast-checkpoint/recovery, with a tuple space view of the future, and spatially through insertion and removal of dynamic code. (4) It supports run-time migration of code modules. The ability to migrate parts of an application as opposed to the whole gives finer grain control over load- balancing decisions.

Figure 1: Interaction between the various components of the Weaves framework.
Figure 1 depicts the design process in the Weaves framework. The design process involves two entities: a programmer who implements the modules and a composer, who uses a graphical user interface to instantiate beads and define the various weaves and strings. The result of the GUI composition is a tapestry configuration file, which is used to load and execute the composed application. Each composed application also has a module called a monitor that is automatically linked with the composed application. The monitor provides a powerful run-time interface to query the state/statistics of the composed application and modify its structure by creating new beads, defining weaves, and instantiating strings at run-time. The Weaves framework has reached prototype capability. The current implementation work by analyzing ELF object files, supporting the vast majority of UNIX platforms and language compilers that use the ELF format. While the Weaves originated as a compiler technology to support scalable network emulation, it has now been extended to support compositional modeling of real-world scientific codes, many of which provide opportunities for selective sharing of global state. These application include (a) the Sweep3D benchmark for discrete-ordinates neutron transport, (b) collaborating ELLPACK partial differential equation solvers, and (c) scalable network emulation in the open network emulator environment.
This work is supported by NSF CAREER-0133840 and NSF NGS-0305644. We thank the National Science Foundation for their support.