Download presentation
Presentation is loading. Please wait.
1
490dp Prelude I: Group Membership Prelude II: Team Presentations Tuples Robert Grimm
2
Group Membership c490dp-a –awong –boriss –dancheah –ishafe –sfanous c490dp-b –bret –cyhung –davidjc –kphilbri –muliawan Try to edit /projects/instr/01wi/cse490dp/[group name]/foo
3
Team Presentations Problem(s) –The problem(s) your application is addressing Features –The functionality of the application Assumptions –Premises about the application domain
4
Team Presentations Components –The structure of the application Unknowns –Things you aren’t sure about –The plan for resolving them Evaluation –The plan for showing that the application Solves the problem(s) Works as advertised
5
Tuples
6
Parallel Computing How to coordinate processes? –Use message passing Point-to-point or group communication Synchronization –Problem Relatively tight coupling –Can we do better?
7
Gelernter Did Better Linda [Carriero & Gelernter 86] –Tuple Ordered collection of typed fields –Tuple space Globally shared collection of tuples
8
Operations Three basic operations –out: Write a tuple –in: Consume a tuple –read: Read a tuple Unblocking and blocking versions –Blocking: Wait for result
9
Template Matching in and read use templates –Ordered collection of formals and values –A template matches a tuple if They have the same size Corresponding values are equal Corresponding formals and values agree –Multiple matches: pick any of them
10
A Simple Application Example Main program –Write out job descriptions –Start helper programs –Collect results Helper programs –Take job description –Perform computation –Write out result
11
Advantages of Tuple Spaces Destination uncoupling –Fully anonymous communications Space uncoupling –Associative access independent of local process Time uncoupling –Tuples stored independent of creating process
12
Distributed Computing Coordination –Similar problems as for parallel computing –Considerably more dynamic environment More generally: Data management –How to represent data? –How to store data? –How to exchange data?
13
Advantages of Tuple Spaces Destination uncoupling Space uncoupling Time uncoupling Idea: Adopt tuple spaces for distributed computing
14
Systems Three systems –JavaSpaces –T Spaces –Structured I/O in one.world In common –Data represented as tuples
15
JavaSpaces Tuple space in / for Java –Typing –Leases –Transactions –Architecture –Potpourri
16
Typed Tuples Convention in Linda –First field is a string denoting the type Strongly typed language: Java –Type provided by class –Unordered collection of named and typed fields Public instance fields –References, but not primitive types
17
Template Matching Template is a tuple –Fields may be null A template matches a tuple if –The tuple has a subtype of the template –Corresponding values are equal Fields are serialized separately –Possible to compare serialized form
18
Leases Problem –How to reclaim obsolete tuples? Solution –Limit their lifetime through leases Acquire Renew Cancel
19
Transactions Problem –How to group operations into one unit? Solution: Transactions –Either all operations complete (commit) –Or no operation complete (abort) –Operations become visible only at commit –Affected tuples are locked down Serializability
20
Architecture Tuple space server –Provides storage –Performs operations Client –Linked in with application –Communicates with server
21
Potpourri notify operation –Triggered when matching tuple is written Unblocking versions –readIfExists, takeIfExists Blocking versions –read, take Implementation may be persistent
22
T Spaces How does T Spaces differ from JavaSpaces?
23
T Spaces Hierarchy of tuple spaces –More flexible structuring Support for queries –Data management Support for access control –Security Extensible implementation –Application-specific functionality
24
Issues What’s wrong with JavaSpaces or T Spaces?
25
Issues Single point of failure –Tuples stored on centralized server Relatively heavy-weight –Client to server to client –Real-time communications Multimedia
26
How to Address These Issues? Localize storage –Add support for replication Offer light-weight communications
27
Structured I/O Tuple-based Storage –Local within environment hierarchy Communication channels –Unreliable On top of UDP –Reliable On top of TCP
28
Detour: Environments Containers for –Stored tuples –Application components –Other environments Combination of file system directories and nested processes Local root functions as the kernel
29
Tuples in one.world Statically typed tuples: Subclasses of Tuple –All instance fields must be public –Fields may be of any type –Default fields: id, metaData Dynamically typed tuples: DynamicTuple –Field declared and typed dynamically Tuples may be nested
30
Operations Basic operations –Communications and storage –put, read, listen Extended operations –Storage only –May be transactional (not implemented) –put, read, listen, query, delete
31
Queries Used by read, listen, and query operations Empty query: always true Unary query: Negation Binary query: Conjunction, disjunction Comparisons –Including ==,, beginsWith, … –hasType, hasSubType, hasDeclaredType, hasField
32
Support for Replication Replication 101 –Log modifying operations –Propagate operations to other nodes How to name data? How to layer replication on top of storage?
33
The Use of IDs Modifying operations use ID as primary key –put operation ID differentiates between –Adding a tuple »No tuple with same ID in store –Overwriting a tuple »Tuple with same ID in store –delete operation: By ID only
34
Why No take Operation? Result only known at end of operation –Harder to log Can still be expressed –Transactional read & delete
35
Discussion Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.