| Tuple Space |
Article Index for Tuple |
Website Links For Space |
Information AboutTuple Space |
| CATEGORIES ABOUT TUPLE SPACE | |
| parallel computing | |
| distributed computing | |
| tree programming languages | |
| java platform | |
| articles with example java code | |
|
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 Smalltalk , Java (JavaSpaces), Python , Ruby , TCL , and Lisp . 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 required 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 a ''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 required 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 can be used to store the system state and implement Distributed Algorithm s. In a JavaSpace all communication partners (peers) communicate by sharing state. JavaSpaces is used to achieve Scalability through parallel processing and provides for reliable storage of objects while reducing the complexity of traditional distributed systems. Processes perform simple operations to write new objects into a JavaSpace, take objects from a JavaSpace, or make copies of objects from the JavaSpace. JavaSpaces is part of the Java Jini technology, which has not been a commercial success, although it has found and kept new users over the years. However some vendors are As Of 2004 offering JavaSpaces-based products. 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''".Rob Guth: " More than just another pretty name: Sun's Jini opens up a new world of distributed computer systems ". ''SunWorld'', August 1998 Januar 2006 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 = new Integer(count.intValue() + 1); return message; } public String toString() { return "Count: " + count.toString(); } } // Hello World! server public class Server { public static void main(String {Link without Title} args) { try { 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 minutes and then retrieve the Entry and check its state.
SpaceEntry e = space.read(new SpaceEntry(), null, Long.MAX_VALUE); System.out.println(e); } catch (Exception e) {} } } // Client public class Client { public static void main(String {Link without Title} args) { try { 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); } catch (Exception e) {} } } Implementations
Books
Interviews Articles REFERENCES SEE ALSO
SOURCES
EXTERNAL LINKS
|
|
|