Tuple space

Tuple space

A tuple space is an implementation of the associative memory paradigm for parallel/distributed computing. It provides a repository of tuples that can be accessed concurrently. As an illustrative example, consider that there are a group of processors that produce pieces of data and a group of processors that use the data. Producers post their data as tuples in the space, and the consumers then retrieve data from the space that match a certain pattern. This is also known as the blackboard metaphor. Tuple space may be thought as a form of distributed shared memory.

Tuple spaces were the theoretical underpinning of the Linda language developed by David Gelernter and Nicholas Carriero at Yale University.

Implementations of tuple spaces have also been developed for Java (JavaSpaces), Lisp, Lua, Prolog, Python, Ruby, Smalltalk, Tcl, and the .NET framework.

Contents

Object Spaces

Object Spaces is a paradigm for development of distributed computing applications. It is characterized by the existence of logical entities, called Object Spaces. All the participants of the distributed application share an Object Space. A provider of a service encapsulates the service as an Object, and puts it in the Object Space. Clients of a service then access the Object Space, find out which object provides the needed service, and have the request serviced by the object.

Object Spaces, as a computing paradigm, was put forward by David Gelernter at Yale University. Gelernter developed a language called Linda to support the concept of global object coordination.

Object Space can be thought of as a virtual repository, shared amongst providers and accessors of network services, which are themselves abstracted as objects. Processes communicate among each other using these shared objects — by updating the state of the objects as and when needed.

An object, when deposited into a space, needs to be registered with an Object Directory in the Object Space. Any processes can then identify the object from the Object Directory, using properties lookup, where the property specifying the criteria for the lookup of the object is its name or some other property which uniquely identifies it. A process may choose to wait for an object to be placed in the Object Space, if the needed object is not already present.

Objects, when deposited in an Object Space are passive, i.e., their methods cannot be invoked while the objects are in the Object Space. Instead, the accessing process must retrieve it from the Object Space into its local memory, use the service provided by the object, update the state of the object and place it back into the Object Space.

This paradigm inherently provides mutual exclusion. Because once an object is accessed, it has to be removed from the Object Space, and is placed back only after it has been released. This means that no other process can access an object while it is being used by one process, thereby ensuring mutual exclusion.

JavaSpaces

JavaSpaces is a service specification providing a distributed object exchange and coordination mechanism (which may or may not be persistent) for Java objects. It is used to store the distributed system state and implement distributed algorithms. In a JavaSpace, all communication partners (peers) communicate and coordinate by sharing state.

JavaSpaces can be used to achieve scalability through parallel processing, it can also be used to provide reliable storage of objects through distributed replication, although this won't survive a total power failure like a disk; it is regarded by many to be reliable as long as the power is reliable. Distribution can also be to remote locations; however, this is rare as JavaSpaces are usually used to low-latency, high performance applications rather than reliable object caching.

The most common software pattern used in JavaSpaces is the Master-Worker pattern. The Master hands out units of work to the "space", and these are read, processed and written back to the space by the workers. In a typical environment there are several "spaces", several masters and many workers; the workers are usually designed to be generic, i.e. they can take any unit of work from the space and process the task.

JavaSpaces is part of the Java Jini technology, which on its own has not been a commercial success. The technology has found and kept new users over the years and some vendors are offering JavaSpaces-based products. JavaSpaces remains a niche technology mostly used in the financial services and telco industries where it continues to maintain a faithful following. The announcement of Jini/JavaSpaces created quite some hype although Sun co-founder and chief Jini architect Bill Joy put it straight that this distributed systems dream will take "a quantum leap in thinking".[1]

Example usage

The following example shows an application made using JavaSpaces. First, an object to be shared in the Object Space is made. Such an object is called an Entry in JavaSpace terminology. Here, the Entry is used to encapsulate a service which returns a Hello World! string, and keeps track of how many times it was used. The server which provides this service will create an Object Space, or JavaSpace. The Entry is then written into the JavaSpace. The client reads the entry from the JavaSpace and invokes its method to access the service, updating its usage count by doing so. The updated Entry is written back to the JavaSpace.

// An Entry class
public class SpaceEntry implements Entry {
     public final String message = "Hello World!";
     public Integer count = 0;
 
     public String service() {
         ++count;
         return message;
     }
 
     public String toString() {
         return "Count: " + count;
     }
}
 
// Hello World! server
public class Server {
     public static void main(String[] args) throws Exception {
         SpaceEntry entry = new SpaceEntry();            // Create the Entry object
         JavaSpace space = (JavaSpace)space();           // Create an Object Space
         // Register and write the Entry into the Space
         space.write(entry, null, Lease.FOREVER);        
         // Pause for 10 seconds and then retrieve the Entry and check its state.
         Thread.sleep(10 * 1000);
         SpaceEntry e = space.read(entry, null, Long.MAX_VALUE);
         System.out.println(e);
     }
}
 
// Client
public class Client {
     public static void main(String[] args) throws Exception {
         JavaSpace space = (JavaSpace) space();
         SpaceEntry e = space.take(new SpaceEntry(), null, Long.MAX_VALUE);
         System.out.println(e.service());
         space.write(e, null, Lease.FOREVER);
     }
}

Books

  • Eric Freeman, Susanne Hupfer, Ken Arnold: JavaSpaces Principles, Patterns, and Practice. Addison-Wesley Professional, 1. June 1999, ISBN 0-201-30955-6
  • Phil Bishop, Nigel Warren: JavaSpaces in Practice. Addison Wesley, 2002, ISBN 0-321-11231-8
  • Max K. Goff: Network Distributed Computing: Fitscapes and Fallacies, 2004, Prentice Hall, ISBN 0131001523
  • Sing Li, et al.: Professional Java Server Programming, 1999, Wrox Press, ISBN 1861002777
  • Steven Halter: JavaSpaces Example by Example, 2002, Prentice Hall PTR, ISBN 0-13-061916-7

Interviews

Articles

Tuple Space Implementations

Project Supported Languages License used Notable features
Apache River Java Apache License Based on the Jini project that Sun contributed to Apache. See page.
The Blitz Project Java BSD License Single site server.
The Fly Object Space Java, Ruby, Scala Commercial.
Allows free non-commercial use.
GigaSpaces Java, .Net, C++ Commercial.
Offers free "community license" with a subset of features.
Clustered, fault-tolerant.
Linda in a Mobile Environment (LIME) Java Unknown
LinuxTuples C, Python BSD License Clustered.
PyLinda Python GPL See page.
Rinda Ruby Ruby License See page.
SemiSpace Java Apache License
SQLSpaces Server: Java.
Clients: Java, C#, PHP, Prolog, Ruby.
AGPL (server) + LGPL (clients)
TIBCO ActiveSpaces Java, C/C++ Commercial Clustered, fault-tolerant.

Inactive Projects:

  • SlackSpaces, open-source, main website down, project source is downloadable
  • SmallSpaces, Open Source implementation of the Linda/Tuplespace programming model
  • TSpaces, by IBM for Java, project stalled since 2000

References

  1. ^ Rob Guth: "More than just another pretty name: Sun's Jini opens up a new world of distributed computer systems". SunWorld, August 1998 [15 January 2006]

See also

Sources

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Space-based architecture — (SBA) is a software architecture pattern for achieving linear scalability of stateful, high performance applications using the tuple space paradigm. It follows many of the principles of Representational State Transfer, Service Oriented… …   Wikipedia

  • Metric space — In mathematics, a metric space is a set where a notion of distance (called a metric) between elements of the set is defined. The metric space which most closely corresponds to our intuitive understanding of space is the 3 dimensional Euclidean… …   Wikipedia

  • Vector space — This article is about linear (vector) spaces. For the structure in incidence geometry, see Linear space (geometry). Vector addition and scalar multiplication: a vector v (blue) is added to another vector w (red, upper illustration). Below, w is… …   Wikipedia

  • Euclidean space — Every point in three dimensional Euclidean space is determined by three coordinates. In mathematics, Euclidean space is the Euclidean plane and three dimensional space of Euclidean geometry, as well as the generalizations of these notions to… …   Wikipedia

  • Topological space — Topological spaces are mathematical structures that allow the formal definition of concepts such as convergence, connectedness, and continuity. They appear in virtually every branch of modern mathematics and are a central unifying notion. The… …   Wikipedia

  • State space (dynamical system) — In the theory of discrete dynamical systems, a state space is a directed graph where each possible state of a dynamical system is represented by a vertex, and there is a directed edge from a to b if and only if ƒ(a) = b where the… …   Wikipedia

  • Knowledge space — In mathematical psychology, a knowledge space is a combinatorial structure describing the possible states of knowledge of a human learner. [citation|title=Knowledge Spaces|last1=Doignon|first1=J. P.|last2=Falmagne|first2=J. Cl.|publisher=Springer …   Wikipedia

  • State space — In computer science, a state space is a description of a configuration of discrete states used as a simple model of machines. Formally, it can be defined as a tuple [N, A, S, G] where: * N is a set of states * A is a set of arcs connecting the… …   Wikipedia

  • Пространство кортежей — (tuple space) реализация парадигмы ассоциативной памяти для параллельных/распределённых вычислений. Она предоставляет репозиторий кортежей с параллельным доступом. Например, можно представить группу процессоров, которые вычисляют данные и… …   Википедия

  • NoSQL — This article is about the class of database management systems. For the specific relational database management software, see NoSQL (RDBMS). Structured storage redirects here. It is not to be confused with COM Structured Storage. In computing,… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”