javaspaces and tspaces n.
Skip this Video
Download Presentation
JavaSpaces and TSpaces

Loading in 2 Seconds...

play fullscreen
1 / 25

JavaSpaces and TSpaces - PowerPoint PPT Presentation

  • Uploaded on

JavaSpaces and TSpaces. Theresa Tamash CDA 5937 November 4, 2002. Outline. Challenges of Distributed Computing Solutions for Distributed Systems Linda Tuplespaces JavaSpaces TSpaces. Challenges of Distributed Computing. Latency – data takes time to get across a network.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'JavaSpaces and TSpaces' - guinevere-mckinney

Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
javaspaces and tspaces

JavaSpaces and TSpaces

Theresa Tamash

CDA 5937

November 4, 2002

  • Challenges of Distributed Computing
  • Solutions for Distributed Systems
  • Linda
  • Tuplespaces
  • JavaSpaces
  • TSpaces
challenges of distributed computing
Challenges of Distributed Computing
  • Latency – data takes time to get across a network.
  • Synchronization – asynchronous processes must have a certain degree of synchronization in order to work together.
  • Partial failures – a distributed system must be able to recognize a failure and be able to adapt.
  • Communication – processes running different operating systems may need to communicate.
  • Persistent data – a distributed system may need somewhere to store data, besides on one of the connected computers.
example communication challenge
Example (communication challenge)





How can the Windows or LINUX machines print documents?

There is a physical connection between all computers and the printer, but no logical connection.


example auction service
Example (auction service)
  • Bids may take different amounts of time to reach the server. Which bid came in first? (latency)
  • Item must be stored on the server. (persistent data)
  • What if the Seller or winning bidder are not connected to the network when bidding ends? (synchronization / partial failures)






solution middleware
Solution - Middleware

Process C

  • The middleware facilitates communication between the different processes.
  • The middleware should be responsible for providing solutions to the problems listed earlier.


Process B

Process A

middleware solutions
Middleware Solutions

JavaSpaces and TSpaces

  • Designed to overcome the challenges of distributed systems.
  • Based on the Linda tuplespace system.
  • Implemented in Java to be platform independent.

Developed to be a communication buffer for parallel processing systems.

  • Anonymous communication
  • Associative addressing / pattern matching
  • Persistent data
  • Simple syntax
  • Portable (supports heterogeneous networks)
  • Uses tuplespaces


  • Stores groups of tuples.
  • Globally accessible memory space (probably on a network).



Put tuple

Take tuple

Tuple – A group of fields with associated values. Basically an object.

{temperature=75; windspeed=10; windunits=knots}

  • A shared, network accessible repository for objects (tuplespace).
  • Based on the tuplespace model of Linda.
  • Objects are exchanged only through interaction with the space.
  • Provides simple operations: read, write, take, notify.
javaspaces key features
JavaSpaces Key Features
  • Shared – spaces provide concurrent access for many processes.
  • Persistent data – spaces store objects until they expire or are removed.
  • Associative lookup – spaces lookup objects based on their content rather than a name or memory address.

Continued 

javaspaces key features cont
JavaSpaces Key Features cont.
  • Transactionally Secure – spaces ensure that operations are atomic (either applied or not).
  • Executable Content Sharing – spaces store objects, which have methods that can be executed once an object is read or taken from a space.
  • Anonymous communication – spaces don’t care who the sender or receiver is.
javaspace hello world



JavaSpace “Hello World”

public class Message implements Entry {

public String content;

public Message() {



Message msg = new Message();

Msg.content = “Hello World”;

JavaSpace space = SpaceAccessor.getSpace();

Space.write(msg, null, Lease.FOREVER);

Write entry

javaspace hello world cont
JavaSpace “Hello World” cont.

Use pattern matching to get desired objects from the space.

null values represent wildcards.

A Message object with the content field set to nullwill return any message object.

A Message object with the content field set to “Go Team!” will only return a message object with the content set to that value.

javaspace hello world cont1


JavaSpace “Hello World” cont.

Message template = new Message(); //Content is null

Message result = (Message)

template, null, Long.MAX_VALUE);


“Hello World”

Read entry


If we had used space.takeinstead, the Entry object would no longer be in the space.

javaspaces solution






JavaSpaces Solution


  • Windows machine writes a printerDocument object to the space.
  • AIX machine is notified when any printerDocument object is written to the space. He takes them upon notification.
  • AIX machine sends the document to the printer to print.
  • The Java Virtual Machines (JVM) enable communication between the two different operating systems through the JavaSpace.
  • Similar to JavaSpaces
  • Based on Linda
  • Implemented in Java for platform independence.
  • Tuples are exchanged through the space.
  • Provides simple operations; read, write, take: as well as more complex operations and database functionality.
tspaces key features
TSpaces Key Features
  • Standard set of tuplespace operators – read and in (both in blocking and non-blocking), out, scan.
  • Dynamically defined datatypes and operators – New datatypes and operators can be defined and downloaded to the TSpaces server and used immediately.
  • Persistent data – relational database features.

Continued 

tspaces key features cont
TSpaces Key Features cont.
  • Database indexing and querying – Provides capability for efficient and powerful data retrieval.
  • Access Control – Configurable security settings.
  • Event Notification – Processes can register to be notified of events.
tspace tuple
TSpace Tuple
  • <2.24, “Hello World”, 345>
  • This is a tuple with 3 fields:
  • Float with value 2.24
  • String with value “Hello World”
  • Integer with value 345
tspace tuple matching
TSpace Tuple Matching

<2.24, “Hello World”, 345>

Template 1: <float, “Hello World”, int> Template 2: <float, string, 345.0>

Both templates use formal fields. By putting the datatype in the template and not specifying a value, the template will match tuples with that datatype in that field.

tspaces solution









TSpaces Solution

Seller writes Item tuple to space.

Bidders can register to receive notification when certain types of Items (pink?) are written to the space.

Bidders can take an Item from a space, update the bid, then write it back.

Bidders can query the group of Item tuples to find ones that interest them.

Seller registers to be notified when bidding ends on their Item.

javaspaces vs tspaces
Serializable objects

Multiple spaces

Simple operators

Simple types and objects

Single space

Simple operators and database functionality

JavaSpaces vs. TSpaces
  • Freeman, E., Hupfer, S., Arnold, K. (1999). JavaSpaces Principles, Patterns, and Practice: Chapter 1.
  • Hupfer, Susanne (2000). The Nuts and Bolts of Compiling and Running JavaSpaces Programs.

Continued 

  • (2000) JavaSpaces Service Specification v1.1.

  • TSpaces Intelligent Connectionware.

  • Wyckoff (1998). T Spaces