Ioana BurceaWon-Ho Park Electrical and Computer Engineering Department University of Toronto Algorithms for Implementation of Tuple Space Expert Topic.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Symbol Table.
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
The Assembly Language Level
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison- Wesley. All rights reserved. 1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
Chapter 9 Subprogram Control Consider program as a tree- –Each parent calls (transfers control to) child –Parent resumes when child completes –Copy rule.
ISBN Chapter 10 Implementing Subprograms.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management -3 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
ISBN Chapter 10 Implementing Subprograms.
Spring 2003 ECE569 Lecture ECE 569 Database System Engineering Spring 2003 Yanyong Zhang
CSCI 4550/8556 Computer Networks Comer, Chapter 19: Binding Protocol Addresses (ARP)
Run-Time Storage Organization
Run time vs. Compile time
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Chapter 9: Subprogram Control
Spring 2004 ECE569 Lecture ECE 569 Database System Engineering Spring 2004 Yanyong Zhang
1 CSCI 360 Survey Of Programming Languages 9 – Implementing Subprograms Spring, 2008 Doug L Hoffman, PhD.
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Chapter 10 Implementing Subprograms. Copyright © 2007 Addison-Wesley. All rights reserved. 1–2 Semantics of Call and Return The subprogram call and return.
CS 333 Introduction to Operating Systems Class 12 - Virtual Memory (2) Jonathan Walpole Computer Science Portland State University.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
CEN Network Fundamentals Chapter 19 Binding Protocol Addresses (ARP) To insert your company logo on this slide From the Insert Menu Select “Picture”
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
CS333 Intro to Operating Systems Jonathan Walpole.
ISBN Chapter 10 Implementing Subprograms.
Values, variables and types © Allan C. Milne v
1 Semantic Analysis Aaron Bloomfield CS 415 Fall 2005.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
IBM TSpaces Lab 1 Introduction. Summary TSpaces Overview Basic Definitions Basic primitive operations Reading/writing tuples in tuplespace HelloWorld.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Basic Semantics Associating meaning with language entities.
David Luebke 1 10/25/2015 CS 332: Algorithms Skip Lists Hash Tables.
CSC3315 (Spring 2008)1 CSC 3315 Subprograms Hamid Harroud School of Science and Engineering, Akhawayn University
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
ISBN Chapter 10 Implementing Subprograms.
Run-Time Storage Organization Compiler Design Lecture (03/23/98) Computer Science Rensselaer Polytechnic.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
 2007 Pearson Education, Inc. All rights reserved C Arrays.
CHAPTER 9 HASH TABLES, MAPS, AND SKIP LISTS ACKNOWLEDGEMENT: THESE SLIDES ARE ADAPTED FROM SLIDES PROVIDED WITH DATA STRUCTURES AND ALGORITHMS IN C++,
CS6045: Advanced Algorithms Data Structures. Hashing Tables Motivation: symbol tables –A compiler uses a symbol table to relate symbols to associated.
Chapter 10 Implementing Subprograms. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 10 Topics The General Semantics of Calls and Returns.
Implementing Subprograms
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
Variables Bryce Boe 2012/09/05 CS32, Summer 2012 B.
Smalltalk Implementation Harry Porter, October 2009 Smalltalk Implementation: Optimization Techniques Prof. Harry Porter Portland State University 1.
Design issues for Object-Oriented Languages
Chapter 10 : Implementing Subprograms
Module 11: File Structure
Paging and Segmentation
Chapter 8: Main Memory.
Chapter 10: Implementing Subprograms Sangho Ha
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Main Memory Background Swapping Contiguous Allocation Paging
Implementing Subprograms
Lecture 3: Main Memory.
Operating System Chapter 7. Memory Management
ICOM 5016 – Introduction to Database Systems
Symbol Table 薛智文 (textbook ch#2.7 and 6.5) 薛智文 96 Spring.
Ch 17 - Binding Protocol Addresses
CS703 - Advanced Operating Systems
COMP755 Advanced Operating Systems
Presentation transcript:

Ioana BurceaWon-Ho Park Electrical and Computer Engineering Department University of Toronto Algorithms for Implementation of Tuple Space Expert Topic ECE 1770 Spring 2003

Agenda l Ioana - Matching Algorithms (in Linda) u Basic Terminology and Concepts u Multi-Key Search Algorithm l Won-Ho - Linda: Implementation of Tuple Space

Basic Terminology l Tuple (out operation) - Ex: u (1, 4.0, “Middleware”) l Template = antituple (in operation) - Ex: u (1, 4.0, ?x) x: string u (1, 4.0, “Middleware”) l Tuple arity - Ex: u (1, ?x)  arity 2 u (1, 4.0, “Middleware”)  arity 3 l Type signature - Ex: u (1, 4.0, “Middleware”)  (int, float, string)

Matching Algorithms l Exhaustive search – too time consuming l Optimizations - Segmenting u Orthogonal subspaces - Based on »tuple arity & type signature »constants - Treated separately - Searching u Zero variable case - In(“mutex”)Out(“mutex”) u One variable case - Single key index u Multiple variable - Multiple key search

Patterns l Actual parameter - Ex: u (1, 4.0, “Middleware”)  1, 4.0, “Middleware” u (1, 4.0, x)  1, 4.0, x l Formal parameter (placeholder / wildcard) - Ex: u ?x (x: string) l Tuple Pattern - Bitvector u its size is given by the arity of the tuple u a bit is set if and only if it corresponds to a actual parameter - Ex: u (1, 4.0, “Middleware”)  (111) u (1, 4.0. ?x)  (110)

Matching Semantics Using Patterns l Compatible patterns - Two tuples P and Q are compatible if and only if P OR Q contains only 1s l Two tuples may match if and only if their patterns are compatible l Must-match pattern - Ex: u Out(a, b, c)  pattern (111) u In (x, ?y, z)  pattern (101) l Matching definition - Two tuples match if and only if u They have the same type signature u Exactly one is an antituple u Their patterns are compatible u Their must-match values are equal OR = (111)  compatible AND = (101)  must-match pattern

Multiple key search l Applied inside each orthogonal subspace l Basic idea: - Build the key search based on the pairs of compatible patterns and must-match values l Ex: - Tuple pattern: (111) - Antituple patterns: (010), (100), (110) u an entry in the dictionary for each pair (tupple pattern, antituple pattern) => each tuple will be referenced by multiple keys u the key of the entry also contains the must-match values u the entry points to the tuple u Ex: out(3, 5, x) => Key: (010:111:5) - ! One record per must-match pattern is not sufficient ! l Property: - If two tuples have the same key => they match l Perfect hash function – one to one correspondence between search keys and the hash keys

Offline Algorithm – in operation 1) Lock subspace 2) Identify antituple’s pattern, p, and store antituple where it can be found via a pointer or other reference. 3) For each compatible tuple pattern, c, in use, 4) Combine p, c, and antituple’s must-match values to form a search key, k. 5) Search dictionary for a tuple reference indexed by k. 6) If one is found, then 7) Delete tuple, antituple and all their references. 8) Goto 10. else 9) Insert a reference to antituple, indexed by k, into dictionary. 10) Unlock subspace 11) If no match was found, then 12) Suspend execution until signalled else 13) Return match result

Online Algorithm l Adapt the tuple space whenever a new pattern is encountered 2.1) If p is a new antituple pattern, then 2.2) Create a new list for p 2.3) For each old, compatible tuple pattern q 2.4) For each tuple t on q’s list 2.5) Insert into dictionary a new reference to t, based on p and q 2.6) Insert antituple in p’s list l Discussion - Usually, no perfect hash u Each hash entry has a hash chain u The hash chain has to be checked until a match is found

Virtual Linda Machine (VLM): Implementation of Linda on Networks l TupleSpaces is a virtually shared memory: - How to implement TupleSpaces in the absence of shared memory - How to find Tuples and where keep them l Components of VLM - Hardware - Network Communication Kernel - Compiler l Hardware is networks, or network computers l The kernel is the program resident on each network node that implements inter-node communication - Performing In(), out(), read() primitive instructions on networks by sending or broadcasting messages l The compiler adds code for maintaining buffer (shared memory)

Run-Time Name Resolution in VLM: How to find Tuples l VLM should provide Name(Tuple)-to-Node(address) mapping information - Centralized in directory nodes - Distributed network-wide (e.g., by means of a network-wide broadcast) l The communication kernel translates Tuple-names into network-addresses on a per-reference basis l Network state and its storage - Only one node generating state information maintains the state - All nodes maintain all state by broadcasting - VLM uses N 1/2 -Node Broadcast Technique.

N 1/2 -Node Broadcast Technique and Name Resolution l Write set : row nodes l Read set : column nodes l P-in-thread process l P-out-thread process l P-in-thread is intercepted by a P-out-thread on node k. l A notification message is generated on k-node, and sent to m-node l The message instructs m-node to send tuple(P…) to n-node. m P-out-thread Out(P…) In(P…) kn P-in-thread A Network Topology

Buffering: Where to keep Tuples l VLM is required to simulate Linda’s infinite global buffer l Buffer is allocated by the compiler-generated code, not by the kernel - in(P….) : allocating a buffer on the execution stack of the process, and referred to buffer P. - out(P…) : Tuples are stored in per-process heaps, and destroyed when it is delivered - Header information required by the communication system l If a process terminates with undelivered Tuples - The buffers are maintained by the communication kernel until delivery occurs