JavaSpaces and Linda Language Ghaith Haddad EEL6897 Fall 2007.

Slides:



Advertisements
Similar presentations
TSpaces Services Suite: Automating the Development and Management of Web Services Presenter: Kevin McCurley IBM Almaden Research Center Contact: Marcus.
Advertisements

JavaSpaces and TSpaces Theresa Tamash CDA 5937 November 4, 2002.
1 Chapter 5 Threads 2 Contents  Overview  Benefits  User and Kernel Threads  Multithreading Models  Solaris 2 Threads  Java Threads.
Linda Coordination Language Presented by Tae Ki Kim
C# and Windows Programming Application Domains and Remoting.
GridRPC Sources / Credits: IRISA/IFSIC IRISA/INRIA Thierry Priol et. al papers.
The road to reliable, autonomous distributed systems
Introduction to Jini & JavaSpaces
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
A New Computing Paradigm. Overview of Web Services Over 66 percent of respondents to a 2001 InfoWorld magazine poll agreed that "Web services are likely.
Distributed Systems Architectures
Comparison of the RMI and the socket APIs
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 1 Introduction/Overview Wed. 9/6/00.
1 CS 194: Distributed Systems Distributed Coordination-based Systems Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering.
Tuple Spaces and JavaSpaces CS 614 Bill McCloskey.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
490dp Prelude I: Group Membership Prelude II: Team Presentations Tuples Robert Grimm.
Web Service What exactly are Web Services? To put it quite simply, they are yet another distributed computing technology (like CORBA, RMI, EJB, etc.).
Hossein Bastan Isfahan University of Technology 1/23.
TupleSpaces Revisited: Linda to TSpaces Ben Y. Zhao 13 July, 1998 UC Berkeley Computer Science Division.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 12 Slide 1 Distributed Systems Architectures.
Institute of Computer and Communication Network Engineering OFC/NFOEC, 6-10 March 2011, Los Angeles, CA Lessons Learned From Implementing a Path Computation.
Enabling Embedded Systems to access Internet Resources.
An program As a simple example of socket programming we can implement a program that sends to a remote site As a simple example of socket.
DNA REASSEMBLY Using Javaspace Sung-Ho Maeung Laura Neureuter.
JavaSpaces Prabhaker Mateti Wright State University.
Cli/Serv.: rmiCORBA/131 Client/Server Distributed Systems v Objectives –introduce rmi and CORBA , Semester 1, RMI and CORBA.
Lecture 15 Introduction to Web Services Web Service Applications.
DCE (distributed computing environment) DCE (distributed computing environment)
Web Services Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Chapter 8-3 : Distributed Systems Distributed systems Distributed systems Document-based middleware Document-based middleware Coordination-based middleware.
©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 13 Java on Various Computer Platforms.
JavaSpaces TM By Stephan Roorda Source: JavaSpaces specification.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Algoval: Evaluation Server Past, Present and Future Simon Lucas Computer Science Dept Essex University 25 January, 2002.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
Coordination Languages and their Significance Paper by: David Gelernter Nicholas Carriero Presented by: Varuna Iyengar.
Coordination Models and Languages Part I: Coordination Languages and Linda Part II: Technologies based on Tuple space concept beyond Linda Part III: Comparison.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
IBM TSpaces Lab 3 Transactions Event Registration.
1 JSK 1.1 A practical Approach Contents –Working with JSK 1.1 –Jini environments –Writing Jini software revisited –Important software packages in the JSK.
JINI Coordination-Based System By Anthony Friel * David Kiernan * Jasper Wood.
Jini Architecture Introduction System Overview An Example.
1 Object Oriented Logic Programming as an Agent Building Infrastructure Oct 12, 2002 Copyright © 2002, Paul Tarau Paul Tarau University of North Texas.
The Client-Server Model And the Socket API. Client-Server (1) The datagram service does not require cooperation between the peer applications but such.
IBM TSpaces Lab 2 Customizing tuples and fields. Summary Blocking commands Tuple Expiration Extending Tuples (The SubclassableTuple) Reading/writing user.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
1 G52IWS: Web Services Chris Greenhalgh. 2 Contents The World Wide Web Web Services example scenario Motivations Basic Operational Model Supporting standards.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
UNIT-6. Basics of Networking TCP/IP Sockets Simple Client Server program Multiple clients Sending file from Server to Client Parallel search server.
January 26, Ken Arnold Copyright 1999 Sun Microsystems, Inc., all rights reserved.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
Distributed and Parallel Processing George Wells.
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
Distributed and Parallel Processing George Wells.
Java Distributed Object System
z/Ware 2.0 Technical Overview
What is RMI? Remote Method Invocation
Object Spaces 9/22/2018.
CMSC 611: Advanced Computer Architecture
Chapter 40 Remote Method Invocation
An Introduction of Jini Technology
JINI ICS 243F- Distributed Systems Middleware, Spring 2001
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Presentation transcript:

JavaSpaces and Linda Language Ghaith Haddad EEL6897 Fall 2007

Walkthrough  Parallel Programming Models  What is Linda?  Linda Model RequirementsRequirements AdvantagesAdvantages Compare with MPICompare with MPI DisadvantagesDisadvantages  Linda Implementations in Java TSpacesTSpaces JavaspacesJavaspaces  Requirements  Complexity  Diagram  In Depth  Example  Transactions  Distributed Events GigaSpacesGigaSpaces ComparisonComparison Research ProjectsResearch Projects  References  Demo

Parallel Programming Models  Set of software technologies to express parallel algorithms and match applications with the underlying parallel systems [2]  Areas include: applications, programming languages, compilers, libraries, communications systems, and parallel I/O  “Roughly” categorized into two kinds of systems: Shared-MemoryShared-Memory Distributed-MemoryDistributed-Memory  Examples: POSIX Threads, MPI, Charm++, Linda, Oz (programming language)

What is Linda  “Linda is a coordination language for parallel and distributed processing, providing a communication mechanism based on a logically shared memory space called tuple space.” [1]  Developed by David Gelernter and Nicholas Carriero at Yale University.  Coordination Language: Model, not Grammar!  tuple space An implementation of the associative memory paradigm for parallel/distributed computingAn implementation of the associative memory paradigm for parallel/distributed computing Structured as a bag of tuplesStructured as a bag of tuples  Tuple Example: ("point", 12, 67), Three fields tupleThree fields tuple 12 and 67 are the x and y coordinates of the point represented by this tuple12 and 67 are the x and y coordinates of the point represented by this tuple Similar to struct or object without methodsSimilar to struct or object without methods

Tuple Space vs. Associative Memory [7]  Allow memory items to be selected by reference to their contents rather than by an address  Every word in the associative memory is searched in parallel against a key held in the comparand register which is the same width as memory

Linda Model Requirements  The original Linda model requires four operations that individual workers perform on the tuples and the tuplespace [3] in: atomically reads and removes -consumes- a tuple from tuplespacein: atomically reads and removes -consumes- a tuple from tuplespace rd: non-destructively reads a tuplespacerd: non-destructively reads a tuplespace out: produces a tuple, writing it into tuplespaceout: produces a tuple, writing it into tuplespace eval: creates new processes to evaluate tuples, writing the result into tuplespaceeval: creates new processes to evaluate tuples, writing the result into tuplespace

Linda Model Requirements  The specification of the tuple to be retrieved makes use of an associative matching technique A subset of the fields in the tuple have their values specifiedA subset of the fields in the tuple have their values specified Used to locate a matching tuple in the tuple spaceUsed to locate a matching tuple in the tuple space Example: in("point", ?x, ?y)is called an anti- tupleExample: in("point", ?x, ?y)is called an anti- tuple anti-tuple: Any tuple with the same number and type of fieldsanti-tuple: Any tuple with the same number and type of fields Anti-tuple is used toAnti-tuple is used to

Linda Model Advantages [3]  More orthogonal Treats process coordination as a separate activity from computation.Treats process coordination as a separate activity from computation. Allows processes computing in different languages and platforms to interoperate using the same primitivesAllows processes computing in different languages and platforms to interoperate using the same primitives  More general: Can subsume various levels of concurrency - uni-processor, multi-threaded multiprocessor, or networked- under a single model.Can subsume various levels of concurrency - uni-processor, multi-threaded multiprocessor, or networked- under a single model. Allows a multi-threaded Linda system to be distributed across multiple computers, or vice- versa, without changeAllows a multi-threaded Linda system to be distributed across multiple computers, or vice- versa, without change

Compare with MPI [3]  Message-passing models require tightly-coupled processes sending messages to each other in some sequence or protocol  Linda processes are decoupled from other processes, communicating only through the tuplespace a process need have no notion of other processes except for the kinds of tuples consumed or produced (data coupling).a process need have no notion of other processes except for the kinds of tuples consumed or produced (data coupling).

Linda Model Disadvantages  The tuple space is unprotected since any process can access any tuple in it [5]  No hierarchical organization of tuples, therefore no sense of name scoping [5]  Decreased speed of operations in Linda systems as compared to MPI systems [3]  At worst, inefficient, and, at best, subject to unpredictable performance [1]  More disadvantages in [6]

Linda Implementations in Java  TSpaces  JavaSpaces  GigaSpaces  Many Other Research Projects…

TSpaces  IBM’s implementation  "the common platform on which we build links to all system and application services“ [8]  Single server process running on the network which makes use of a textual configurations file [1]  Transports tuples across the network using the standard Java object serialization mechanisms and TCP/IP sockets [1]  New commands can be added relatively easily [1]

TSpaces

JavaSpaces  Forms part of the Jini system, and so makes extensive use of the Jini API [9]  Network support is provided by the Java RMI (Remote Method Invocation) protocol [10]  Distribution of classes to clients is handled by the standard Internet hypertext protocol (HTTP) [1]  Supports the basic Yale Linda operations (the names differ from the original names used by the Yale group, but essentially the same functionality is provided)

JavaSpaces

JavaSpaces – Requirements [1]  a web (HTTP) server (a minimal one is provided with the Jini/JavaSpaces release)  an RMI activation server (part of the standard RMI software bundled with Java)  a Jini lookup service (alternatively the RMI registry service can be used, but this is discouraged as support for this option may be discontinued by Sun in the future)  a Jini transaction manager  a JavaSpaces server  Applications are also required to run a security manager, whether security checking is required or not

JavaSpaces – Complexity [1]  A typical command line required to run a JavaSpaces application is as follows java -Djava.security.policy= D:\JavaProgs\policy.all -Doutrigger.spacename=JavaSpaces-Dcom.sun.jini.lookup.groups=public -Djava.rmi.server.codebase= examples-dl.jar -cp D:\JavaProgs\space- examples.jar;D:\JavaProgs\classes sun.applet.AppletViewer worker.html

JavaSpaces – Diagram [11]

JavaSpaces – In Depth [11]  All operations are invoked on an object that implements the net.jini.space.JavaSpace interface.  A space stores entries, each of which is a collection of typed objects that implements the Entry interface import net.jini.core.entry.*; public class MessageEntry implements Entry { public String content; public MessageEntry() { } public MessageEntry(String content) { this.content = content; } public String toString() { return "MessageContent: " + content; }}

Net.jini.space.JavaSpace Interface [12] EventRegistration notify(Entry tmpl, Transaction txn, RemoteEventListener listener, long lease, MarshalledObject handback) - When entries are written that match this template notify the given listener with a RemoteEvent that includes the handback object. Entry read(Entry tmpl, Transaction txn, long timeout) - Read any matching entry from the space, blocking until one exists. Entry readIfExists(Entry tmpl, Transaction txn, long timeout) - Read any matching entry from the space, returning null if there is currently is none. Entry snapshot(Entry e) - The process of serializing an entry for transmission to a JavaSpaces service will be identical if the same entry is used twice. Entry take(Entry tmpl, Transaction txn, long timeout) - Take a matching entry from the space, waiting until one exists. Entry takeIfExists(Entry tmpl, Transaction txn, long timeout) - Take a matching entry from the space, returning null if there is currently is none. Lease write(Entry entry, Transaction txn, long lease) - Write a new entry into the space. 

JavaSpaces – Example import net.jini.space.JavaSpace; public class SpaceClient { public static void main(String argv[]) { try { System.out.println("Searching for a JavaSpace..."); Lookup finder = new Lookup(JavaSpace.class); JavaSpace space = (JavaSpace) finder.getService(); System.out.println("A JavaSpace has been discovered."); System.out.println("Writing a message into the spce..."); MessageEntry msg = new MessageEntry(); msg.content = "Hello there"; space.write(msg, null, 60*60*1000); MessageEntry template = new MessageEntry(); System.out.println("Reading a message from the space..."); MessageEntry result = (MessageEntry) space.read(template, null, Long.MAX_VALUE); System.out.println(“Message read is: "+result.content); } catch(Exception e) {e.printStackTrace();} }}

JavaSpaces – Transactions [11]  Package: net.jini.core.transaction  Provides basic atomic transactions that group multiple operations across multiple JavaSpaces services into a bundle that acts as a single atomic operation  Either all modifications within the transactions will be applied or none will regardless of whether the transaction spans one or more operations or one or more JavaSpaces servicesregardless of whether the transaction spans one or more operations or one or more JavaSpaces services  Transactions can span multiple spaces and participants  A read(), write(), or take() operation that has a null transaction acts as if it were in a committed transaction that contained that operation.

JavaSpaces – Distributed Events [14]  Defined in the Jini Technology Core Platform Specification Defines interfaces and requirements placed on Jini which is capable of sending remote eventsDefines interfaces and requirements placed on Jini which is capable of sending remote events The JavaSapces Specification overrides Jini specification, it provides more details on how a JavaSpace implements remote eventsThe JavaSapces Specification overrides Jini specification, it provides more details on how a JavaSpace implements remote events  A remote event model allows an object in one JVM to register as a listener to an object on another JVM Example: a JavaSpace can send remote events when an entry matching a specified template is written into the spaceExample: a JavaSpace can send remote events when an entry matching a specified template is written into the space

GigaSpaces [13]   Developed as a commercial implementation of the JavaSpaces specification, with some features added: Operations on multiple tuples Updating, deleting and counting tuples Iterating over a set of tuples matching an anti-tuple Distributed implementations of the Java Collections List, Set and Map interfaces Message queuing mechanism   Efficient implementation of GigaSpaces Buffered writes Indexing of tuples (with or without intervention from the application developer) Support for non-Java clients to access GigaSpaces through the use of the SOAP protocol over HTTP Support for web servers to make use of GigaSpaces to share session information (potentially even between separate web servers)

Comparison [1]  TSpaces is unique in providing an extensible form of matching through the ability to add new commands

Research projects  XMLSpaces [15] Designed to support the use of XML data in tuplesDesigned to support the use of XML data in tuples Built over TSpacesBuilt over TSpaces Supports a distributed tuple space modelSupports a distributed tuple space model  CO 3 PS [16] "Computation, Coordination and Composition with Petri net Specifications“"Computation, Coordination and Composition with Petri net Specifications“  Java-Linda [17] a student project at Yale Universitya student project at Yale University  eLinda [18] A model close to the standard Linda modelA model close to the standard Linda model Three ImplementationsThree Implementations  eLinda1: Fully distributed tuple space  eLinda2: Centralised tuple space, like JavaSpaces, TSpaces  eLinda3: Like in eLinda2, but with “broadcast” tuples cached on each processing node

References  [1] Linda implementations in Java for concurrent systems- G. C. Wells1;x, A. G. Chalmers and P. G. Clayton – © 2003 John Wiley & Sons Ltd.  [2]  [3]  [4] G. Andrews, “ Concurrent Programming: Principles and Practice”, Benjamin/Cummings Publishing Company, Inc., Redwood City, CA  [5] Drucker, R.; Frank, A., "A C++/Linda model for distributed objects," Computer Systems and Software Engineering, 1996., Proceedings of the Seventh Israeli Conference on, vol., no., pp , Jun 1996  [6] Ericsson-Zenith (1992). Process Interaction Models. Paris University  [7]  [8] IBM. The TSpaces vision. URL:  [9] Sun Microsystems. Jini connection technology. URL:  [10] C. Austin and M. Pawlan. Advanced Programming for the Java 2 Platform. Addison-Wesley, September 2000  [11]  [12]  [13] GigaSpaces Technologies Ltd. Gigaspaces. URL:  [14] P. Bishop and N. Warren, JavaSpaces in Practice, Addison-Wesley, 2002  [15] R. Tolksdorf and D. Glaubitz. Coordinating web-based systems with documents in XMLSpaces. URL:  [16] T. Holvoet. An Approach for Open Concurrent Software Development. PhD thesis, Department of Computer Science, K.U.Leuven, December 1997  [17] A. Smith. Towards wide-area network Piranha: Implementing Java-Linda. URL:  [18] G.C. Wells. A Programmable Matching Engine for Application Development in Linda. PhD thesis, University of Bristol, U.K., 2001

Demo…