GENERATIVE COMMUNICATION
IN LINDA AND OBJECT/TUPLE
SPACE
- Sheng Tian, shengt@gmail.com
LINDA: COORDINATION AMONG
PARALLEL PROCESSES THROUGH TUPLE
SPACE.
2
COMMUNICATE VIA TUPLE SPACE
To send to B, A generates a tuple
out(N, P2, …, Pj)
… and B withdraws it
in(N, P2, …, Pj) 3
BASIC OPERATIONS ON THE
TUPLES AND TUPLE SPACES
  Tuple: N, P2, …, Pj
  N is an actual parameter of type name
  P2, …, ...
TUPLE SPACES BASICS
OPERATIONS
5
AGENDA
  Background
  Basic Concepts in Generative Communication
  Distinguishing Properties of Linda
  Case Study
  ...
BACKGROUND
  Three basic models of concurrent programming:
  Monitors (shared variables)
  Message passing
  Remote Op...
BASIC CONCEPTS
  Tuple
  A tuple is a fixed-length list containing elements that do not need to
have the same type.
  T...
DISTINGUISHING PROPERTIES (1/2)
  Communication orthogonality
  p1: Space-uncoupling
  A tuple in TS tagged “P” may be ...
SPACE AND TIME UNCOUPLING
Space-disjoint processes A and B
communicate via TS
Time-disjoint processes C and D. C
terminate...
DISTINGUISHING PROPERTIES (2/2)
  Free naming
  p4: Support for continuation passing
  Linda allows name-type values to...
CASE STUDY (1/2)
  Database Search Problem
  We are given a file containing a set of search data, a target,
and a routin...
CASE STUDY (2/2)
13
begin
count = 0
until EOF do
read datum from file
OUT("datum", datum)
count = count + 1
enddo
best = 0...
SPACE BASED ARCHITECTURE
  Object Spaces is a paradigm for development of
distributed computing applications.
  Spaces c...
IMPLEMENTATIONS OF TUPLE
SPACES
  Java
  Sun’s JavaSpaces
  GigaSpaces
  OpenSpaces
  IBM’s Tspaces
  ActiveSpace
 ...
DISCUSSION (1/2)
  Message queue vs. Tuple space
  Messages go from one person to another. Only the intended
recipient o...
DISCUSSION (2/2)
  Tuple Space Scalability
  Tuple Space won’t work on the Internet, because of
its underlying “distribu...
Upcoming SlideShare
Loading in …5
×

generative communication in Linda and tuplespace

1,117 views

Published on

A introduction of generative communication in Linda and Tuple Space

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,117
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

generative communication in Linda and tuplespace

  1. 1. GENERATIVE COMMUNICATION IN LINDA AND OBJECT/TUPLE SPACE - Sheng Tian, shengt@gmail.com
  2. 2. LINDA: COORDINATION AMONG PARALLEL PROCESSES THROUGH TUPLE SPACE. 2
  3. 3. COMMUNICATE VIA TUPLE SPACE To send to B, A generates a tuple out(N, P2, …, Pj) … and B withdraws it in(N, P2, …, Pj) 3
  4. 4. BASIC OPERATIONS ON THE TUPLES AND TUPLE SPACES   Tuple: N, P2, …, Pj   N is an actual parameter of type name   P2, …, Pj is a list of parameters each of which may be either an actual or a formal.   Insert: out(N, P2, …, Pj)   Execution of the out() statement results in insertion of the tuple N, P2, …, Pj into TS   Blocking read and delete: in(N, P2, …, Pj)   If some type-consonant tuple whose first component is “N” exists in TS, the tuple withdraw from TS   If no matching tuple is available in TS, in() suspends until one is available   Blocking read: read(N, P2, …, Pj)   Same as in() statement but the tuple remains in TS.   Both in() and read() are logically nondeterminism   Tuple names are global to a given program’s TS.   Update tuple: delete and reinsert   Predicate operations: inp and rdp 4
  5. 5. TUPLE SPACES BASICS OPERATIONS 5
  6. 6. AGENDA   Background   Basic Concepts in Generative Communication   Distinguishing Properties of Linda   Case Study   Discussion 6
  7. 7. BACKGROUND   Three basic models of concurrent programming:   Monitors (shared variables)   Message passing   Remote Operations   Cons   Partially distributed in space   Nondistributed in time   New Model: Generative communication   Fully distributed in space and time 7
  8. 8. BASIC CONCEPTS   Tuple   A tuple is a fixed-length list containing elements that do not need to have the same type.   Tuple/Object Space   A virtual repository of tuple, shared amongst providers and accessors of network services, that can be accessed concurrently   All the participants of the distributed application share an Object Space.   Processes communicate among each other using these shared objects – by updating the state of the objects as and when needed   Linda   A model of coordination and communication among several parallel processes operating upon objects stored in and retrieved from Tuple Space.   Generative Communication Model   Why it is said to be generative? Because, until it is explicitly withdrawn, the tuple generated by A has an independent existence in TS. 8
  9. 9. DISTINGUISHING PROPERTIES (1/2)   Communication orthogonality   p1: Space-uncoupling   A tuple in TS tagged “P” may be input by any number of address-space-disjoint processes   p2: Time-uncoupling   Tuples added to TS by out() remains in TS until it is removed by in()   p3: Distributed sharing   Linda allows j address-space-disjoint processes to share some variable v by depositing it in TS. 9
  10. 10. SPACE AND TIME UNCOUPLING Space-disjoint processes A and B communicate via TS Time-disjoint processes C and D. C terminates before D starts – Likewise communicate via TS 10
  11. 11. DISTINGUISHING PROPERTIES (2/2)   Free naming   p4: Support for continuation passing   Linda allows name-type values to be tuple components and to be stored in arbitrary data structures in the same way as values of any other type.   p5: Structured naming   Structured naming make TS content-addressable   e.g.   The statement   in(P, i: integer, j:boolean)   Requests a tuple with name “P”, but it is also possible to write   in(P, i:integer, FALSE) and in(P, 2, FALSE)   It allows in() and read() statements to restrict, and out() statements to widen, their focus. 11
  12. 12. CASE STUDY (1/2)   Database Search Problem   We are given a file containing a set of search data, a target, and a routine that computes a numeric score for single datum/ target pair.   A manager makes a series of out requests to place the search data in the tuple space, then performs in operations to retrieve the results generated by workers 12
  13. 13. CASE STUDY (2/2) 13 begin count = 0 until EOF do read datum from file OUT("datum", datum) count = count + 1 enddo best = 0.0 for i = 1 to count IN("score", value) if value > best then best = value endfor for i = 1 to numworkers OUT("datum", "stop") endfor end begin IN("datum", datum) until datum = "stop" do value = compare (datum, target) OUT("score", value) IN("datum", datum) enddo end procedure manager procedure worker
  14. 14. SPACE BASED ARCHITECTURE   Object Spaces is a paradigm for development of distributed computing applications.   Spaces can be used to achieve scalability through parallel procesing.   Objects, when deposited in an Object Space are passive, i.e., their methods cannot be invoked while the objects are in the Object Space.   This paradigm inherently provides mutual exclusion.   Linda coordination language was developed at Yale.   Object Spaces is usually called Tuple Spaces since it contains of tuples unrelated to each others. 14
  15. 15. IMPLEMENTATIONS OF TUPLE SPACES   Java   Sun’s JavaSpaces   GigaSpaces   OpenSpaces   IBM’s Tspaces   ActiveSpace   Jada   LighTS   Jxtaspaces for P2P   GLOBE   Blitz   C   Scientific Computing Associates’ TCP-Linda   W.F. Wong’s Simple C- Linda with Posix Threads   HTML Page Spaces   Masatoshi Seki’s Rinda, part of DistributedRuby dRuby   Ruple for Ruby   p4-Linda   Python   PyBrenda in Python   PyLinda. Linda implementation in Python   Matlab: NetWorkSpaces   Note:   Ruple use XML documents instead of tuples 15
  16. 16. DISCUSSION (1/2)   Message queue vs. Tuple space   Messages go from one person to another. Only the intended recipient of a message gets to see it.   Tuple Space is a bag with tuple in it. The tuples in TS can be read and processed by anyone.   It is possible to force sequencing of messages by including a time, matching on all messages, then selecting the message with the earliest time.   Message passing must has a destination. No matter it's a single dest or a group. However Tuple space is distributed. Workers don't know each other.   Broadcast messages are not like Tuple Space.   A broadcast message is received by everyone whether they want it or not   Tuples are extracted or copied under the control of the reader/ receiver 16
  17. 17. DISCUSSION (2/2)   Tuple Space Scalability   Tuple Space won’t work on the Internet, because of its underlying “distributed shared memory” idea 17

×