Learning Center
Plans & pricing Sign in
Sign Out

ICS 143 - Introduction to Operating Systems


									Distributed Systems
       Prof. Nalini Venkatasubramanian
   Dept. of Information & Computer Science
         University of California, Irvine

CS 237 - Distributed Systems
Middleware – Spring 2011
    Lecture 1 - Introduction to Distributed Systems
         Tuesdays, Thursdays 12:30-1:50p.m.
           Prof. Nalini Venkatasubramanian

                 Intro to Distributed Systems
                          Middleware                  2
Course logistics and details
Course Web page -
Lectures – TuTh 12:30 – 1:50 p.m
Reading List
     Technical papers and reports
     Reference Books

                    Intro to Distributed Systems
                             Middleware            3
Course logistics and details
  Paper summaries
  Survey paper
Course Presentation
Course Project
  Maybe done individually or in groups
  Potential projects will be available on webpage

                    Intro to Distributed Systems
                             Middleware              4
CompSci 237 Grading Policy
Homeworks - 30%
        • 1 paper summary due every week
        • (3 randomly selected each worth 10% of the final

Survey Paper - 10%
Class Presentation - 10%
Class Project - 50% of the final grade
Final assignment of grades will be based on a

                     Intro to Distributed Systems
                              Middleware                     5
Lecture Schedule
 Weeks 1,2: Fundamentals
       •   General Purpose Middleware , Adaptive Middleware
       •   Distributed Operating Systems
       •   Messaging, Communication in Distributed Systems
       •   Naming and Directory Services
       •   Distributed I/O and Storage Subsystems
 Weeks 3,4,5,6,7: Middleware Frameworks
   Distributed Computing Frameworks – DCE, Hadoop
   Object-based Middleware –CORBA, COM
   Java Based Technologies – Java RMI, JINI, J2EE, EJB
   Database access and integration middleware (ODBC, JDBC,
   Messaging Technologies
       • XML Based Middleware, Publish/Subscribe Technologies
   Service Oriented Architectures
       • .NET, Web Services, SOAP, REST, Service Gateways
   Cloud Computing Platforms and Technologies
       • Amazon EC2, Amazon S3, Microsoft Azure, Google App Engine
                        Intro to Distributed Systems
                                 Middleware                          6
Course Schedule

 Weeks 8, 9 and 10: Middleware for Distributed
  Application Environments
    Real-time and QoS-enabled middleware
    Middleware for Fault tolerant applications
    Middleware for Mobile and Pervasive Environments
    Middleware for P2P architectures
    Middleware for Grid/Cloud Computing
    Middleware for Secure applications

                     Intro to Distributed Systems
                              Middleware                7
What is Middleware?

 Middleware is the software between the
  application programs and the operating
  System and base networking
 Integration Fabric that knits together
  applications, devices, systems software, data
 Middleware provides a comprehensive set of
  higher-level distributed computing
  capabilities and a set of interfaces to access
  the capabilities of the system.
                Intro to Distributed Systems
                         Middleware                8
         The Evergrowing Alphabet Soup
   Computing                                  WS-BPEL
Environment (DCE)‫‏‬                              WSIL
                         Java Transaction API (JTA)‫‏‬
    Orbix     WSDL                                               LDAP
                     JNDI                      JMS
  IOP         BPEL                            BEA Tuxedo®
  IIOP                                                           EAI
         Object Request Broker                     RTCORBA
                 (ORB)‫‏‬           SOAP         Message Queuing (MSMQ)‫‏‬
                                 Distributed Component          XQuery
                                 Object Model (DCOM)   opalORB
                                  IDL  Remote Method        XPath

                         INITM ORBlite
                                            (RMI)‫‏‬   Encina/9000
                                      BEA WebLogic® JavaBeans
 Remote Procedure Call                                Technology
          (RPC)‫‏‬                                         (EJB)‫‏‬
 Extensible Markup Language (XML)‫‏‬
      Borland® VisiBroker®
More Views of Middleware
 software technologies to help manage complexity and
  heterogeneity inherent to the development of distributed
  systems, distributed applications, and information
 Higher-level programming abstraction for developing the
  distributed application
 higher than “lower” level abstractions, such as sockets
  provided by the operating system
   a socket is a communication end-point from which data can be
    read or onto which data can be written

                         From Arno Jacobsen lectures, Univ. of Toronto
Middleware Systems – more
 aims at reducing the burden of developing distributed
  application for developer
 informally called “plumbing”, i.e., like pipes that connect
  entities for communication
 often called “glue code”, i.e., it glues independent
  systems together and makes them work together
 it masks the heterogeneity programmers of distributed
  applications have to deal with
   network & hardware
   operating system & programming language
   different middleware platforms
   location, access, failure, concurrency, mobility, ...
 often also referred to as transparencies, i.e., network
  transparency, location transparency
                           From Arno Jacobsen lectures, Univ. of Toronto
Middleware Systems Views
 an operating system is “the software that makes the
  hardware usable”
 similarly, a middleware system makes the distributed
  system programmable and manageable
 bare computer without OS could be programmed, so
  could the distributed application be developed without
 programs could be written in assembly, but higher-level
  languages are far more productive for this purpose

                      From Arno Jacobsen lectures, Univ. of Toronto
Distributed Systems
Multiple independent computers that appear as
  Lamport’s Definition
     “ You know you have one when the crash of a
      computer you have never heard of stops you from
      getting any work done.”
  “A number of interconnected autonomous computers
   that provide services to meet the information
   processing needs of modern enterprises.”

                    Intro to Distributed Systems
                             Middleware                 14
Examples of Distributed
Banking systems
Communication - email
Distributed information systems
  Federated Databases
Manufacturing and process control
Inventory systems
General purpose (university, office automation)

                  Intro to Distributed Systems
                           Middleware              15
Characterizing Distributed
Multiple Computers
  each consisting of CPU’s, local memory, stable
   storage, I/O paths connecting to the environment
  some I/O paths interconnect computers that talk to
   each other
Shared State
  systems cooperate to maintain shared state
  maintaining global invariants requires correct and
   coordinated operation of multiple computers.
                    Intro to Distributed Systems
                             Middleware                 16
Why Distributed Computing?
Inherent distribution
  Bridge customers, suppliers, and companies at
   different sites.
Speedup - improved performance
Fault tolerance
Resource Sharing
  Exploitation of special hardware
                    Intro to Distributed Systems
                             Middleware            17
Why are Distributed Systems
  numeric, geographic, administrative
Loss of control over parts of the system
Unreliability of message passing
  unreliable communication, insecure communication,
   costly communication
  Parts of the system are down or inaccessible
  Independent failure is desirable

                    Intro to Distributed Systems
                             Middleware                18
Design goals of a distributed
  HW, SW, services, applications
  use of standard interfaces, advertise services,
  compete vs. cooperate
  avoids centralization
Fault tolerance/availability
  location, migration, replication, failure, concurrency
                     Intro to Distributed Systems
                              Middleware                    19

               • Personalized Environment
               • Predictable Response
               • Location Independence
               • Platform Independence

                   • Flexibility
• Code Reusability • Real-Time Access • Increased
• Interoperability to information         Complexity
• Portability      • Scalability        • Lack of Mgmt.
• Reduced          • Faster Developmt.    Tools
  Complexity         And deployment of • Changing
                     Business Solutions Technology
                  ORGANIZATION                   [Khanna94]
                  Intro to Distributed Systems
                           Middleware                     20
                        Enterprise Systems:
Management          Perform enterprise activities
and Support            Application Systems:
                     support enterprise systems

              Distributed Computing Platform
              • Application Support Services (OS,

                DB support, Directories, RPC)
              • Communication Network Services

                (Network protocols, Physical devices)
              • Hardware

                        Intro to Distributed Systems
                                 Middleware             21
              Enterprise Systems:
Management    •Engineering systems • Manufacturing
and Support   •Business systems    • Office systems
              Application Systems:
                  User      Processing Data files &
               Interfaces    programs     Databases
              Distributed Computing Platform
               • Application Support Services
                            Dist. Data Distributed

              C/S Support
                           Trans. Mgmt.       OS

              Common Network Services
              • Network protocols & interconnectivity
                            TCP/IP         SNA
                        Intro to Distributed Systems
                                 Middleware             22
                                                                                             The Enterprise Services Bus
                                                                                               Workflow Management and Business Activity Monitoring
 An Event-driven Architecture for a Real-time Enterprise

Modeler                                                                       start             halt            add                              6
                                                                                              resume          remove
                                                                   Deploy                                                           Visualize
                                                                                   Control             Redirect      Update                     Monitor           ...

                                                                                                        Workflow and Business Process Execution
                                                                                                                                                                                              Business Process

                                                                                        WPS (BPEL)                            WCS (ESB)

                                                                                                                  Communication Abstractions                                                   Communication
                                                                        Publish/Subscribe             Point-to-Point          Request/Reply                      Orchestration

                                                                                                             Content-based Routing                                                            Business Process
                                                                                                                                 Clients (publisher/subscriber)                               Execution Events
                                                                                             Content-based Router

                                                                                                                                                                                                Network and
                                                                       Computers                                                                                               Computers       System Events
                                                                                                                       Laptops               Server Database
                                                                                                                              4                                           Server
                                                           Computers                                                   CA*net
                                                                                             Switch                                    Switch
                                                                                                                                                                                                  Event Management
                                                                       Server Farm                            Switch
                                                                                                Database                                                         Server                              Framework
                                                                                                       Computing, Storage, Instruments and Networking Resources
Distributed Systems & Middleware
Research at UC Irvine
 Safe and Adaptive Middleware
     CompOSE|Q - Safe composability of m/w services and protocols
        Security, fault tolerance, reliability, QOS, mobility
     Contessa – Context Sensitive System Adaptation (formal methods based)
        Adaptive Data Collection – wireless and instrumented sensor networks
        Adaptive Communication -- groupware on MANETS, mesh networks,
        Adaptive Middleware for Mobile Applications
 Mobile Multimedia Systems and Applications
     FORGE – Cross-Layer Adaptation (OS, Device, Network, Application) Techniques
     xTune: On-the-fly formal methods for cross-layer adaptation
     MAPGRID – Grid/Cloud Computing for Mobile Applications
 Pervasive Computing Systems and Applications
     Responsphere – A Next Generation Pervasive Computing Testbed
     SATWARE – Stream Acquisition and Transformation Middleware
 Application Focused Distributed Systems Research
     RESCUE: Improving Information Flow in Crises
     SAFIRE: Situational Awareness for Firefighters
     Multimedia Applications

  Research Approach

 Design and develop adaptive middleware for distributed applications

                                      When, where, how to adapt

Formal Methods
  Foundation                            Algorithms
                                                                                   Genetic     Game
                                                                       Machine    Algorithms   Theory

                    Systems                                       Statistical

          Design, implementation, evaluation

Mobile Middleware

                      Dynamo: Power Aware Mobile Middleware
To build a power-cognizant distributed middleware framework that can
    o exploit global changes (network congestion, system loads, mobility patterns)
    o co-ordinate power management strategies at different levels
         (application, middleware, OS, architecture)
    o maximize the utility (application QoS, power savings) of a low-power device.
    o study and evaluate cross layer adaptation techniques for performance vs. quality vs.
    power tradeoffs for mobile handheld devices.

                                   Caching       Compress
Network Infrastructure
                                   Encryption    Decryption

                                  Compositing    Transcode

                                   Execute Remote Tasks
                                                                                   mobile device

                     Wide Area                                Wireless
                      Network                                 Network


                           Use a Proxy-Based Architecture
Middleware for Pervasive Systems -

      Campus-wide infrastructure to instrument, experiments,
        monitor, disaster drills & to validate technologies

     sensing, communicating, storage & computing infrastructure

     Software for real-time collection, analysis, and processing of
                          sensor information

      used to create real time information awareness & post-drill

                                        28                            28
  SAFIRENET – Next Generation MultiNetworks
       Information need
                                        Multitude of technologies
                                           WiFi (infrastructure, ad-hoc), WSN,
                                            UWB, mesh networks, DTN, zigbee
                                        SAFIRE Data needs
                                           Timeliness
                                              immediate medical triage to a
                                               FF with significant CO exposure
                                           Reliability

                                              accuracy levels needed for CO
       networks                                monitoring
                                        Limitations
                                           Resource Constraints
                                              Video, imagery
                                              Transmission Power, Coverage,
                                           Failures and Unpredictability
              Sensors                   Goal
                                           Reliable delivery of data over
       Dead Reckoning                       unpredictable infrastructure
       Irrelevant data)

  Mote Sensor Deployment
Heart Rate
             Proprietary EMF

Polar T31 Heart rate      Polar Heart
strap transmitter         Rate
                                                                            Crossbow MIB510
                          Module                                            Serial Gateway
                                        Crossbow MDA 300CA
Inertial positioning                    Data Acquisition
                                        board on MICAz
         IMU (5 degrees                 2.4Ghz Mote

         of freedom)
                                              IEEE 802.15.4 (zigbee)

                               Carbon monoxide

Temperature, humidity                                                  Carboxyhaemoglobin, light

SATware: A semantic middleware for
multisensor applications

   - makes programming
   - hides heterogeneity,
   failures, concurrency
Provides core services across
         - alerts, triggers,
   storage, queries
Mediates app needs and
  resource constraints
       - networking,
   computation, device

Next Generation Alerting and Warning

                                   the Large

     Delivery Layer              Content Layer                  Systems and
       Research                   Research                      Deployments

 Wired          Wireless                   Content
                            Publish                      CrisisAlert   DisasterPortal
Networks        Networks                 Customization

Classifying Distributed
Based on degree of synchrony
Based on communication medium
  Message Passing
  Shared Memory
Fault model
  Crash failures
  Byzantine failures

                    Intro to Distributed Systems
                             Middleware            33
Computation in distributed
 Asynchronous system
   no assumptions about process execution speeds and message
    delivery delays
 Synchronous system
   make assumptions about relative speeds of processes and delays
    associated with communication channels
   constrains implementation of processes and communication
 Models of concurrency
   Communicating processes
   Functions, Logical clauses
   Passive Objects
   Active objects, Agents

                        Intro to Distributed Systems
                                 Middleware                     34
Concurrency issues
Consider the requirements of transaction based
  Atomicity - either all effects take place or none
  Consistency - correctness of data
  Isolated - as if there were one serial database
  Durable - effects are not lost
General correctness of distributed computation

                     Intro to Distributed Systems
                              Middleware               35
Flynn’s Taxonomy for Parallel

                             Single (SI)         Multiple (MI)

                                SISD                  MISD
          Single (SD)

                           Single-threaded         Pipeline
                               process           architecture

          Multiple (MD)

                               SIMD                   MIMD
                          Vector Processing     Multi-threaded
SISD (Single Instruction
Single Data Stream)


                   D    D   D       D          D   D   D


 A sequential computer which exploits no parallelism in either the
 instruction or data streams.
 Examples of SISD architecture are the traditional uniprocessor machines
 (currently manufactured PCs have multiple processors) or old mainframes.

                  D0   D0   D0        D0       D0   D0   D0
                  D1   D1   D1        D1       D1   D1   D1
                  D2   D2   D2        D2       D2   D2   D2
                  D3   D3   D3        D3       D3   D3   D3
                  D4   D4   D4        D4       D4   D4   D4
                  …    …     …        …        …    …    …
                  Dn   Dn   Dn        Dn       Dn   Dn   Dn

A computer which exploits multiple data streams against a single instruction
stream to perform operations which may be naturally parallelized.
For example, an array processor or GPU.
MISD (Multiple Instruction
Single Data)




  Multiple instructions operate on a single data stream.
  Uncommon architecture which is generally used for fault tolerance.
  Heterogeneous systems operate on the same data stream and
  aim to agree on the result.
  Examples include the Space Shuttle flight control computer.
                         Intro to Distributed Systems
                                  Middleware                           39

                         D   D    D       D          D   D   D


                         D   D    D       D          D   D   D

Multiple autonomous processors simultaneously executing different instructions on
different data.
Distributed systems are generally recognized to be MIMD architectures;
either exploiting a single shared memory space or a distributed memory space.
Communication in Distributed
Provide support for entities to communicate
 among themselves
  Centralized (traditional) OS’s - local communication
  Distributed systems - communication across machine
   boundaries (WAN, LAN).
2 paradigms
  Message Passing
     Processes communicate by sharing messages
  Distributed Shared Memory (DSM)
     Communication through a virtual shared memory.

                    Intro to Distributed Systems
                             Middleware                41
Message Passing
 Basic communication primitives
   Send message
   Receive message
 Modes of communication
      atomic action requiring the participation of the sender and receiver.
      Blocking send: blocks until message is transmitted out of the system
       send queue
      Blocking receive: blocks until message arrives in receive queue
      Non-blocking send:sending process continues after message is sent
      Blocking or non-blocking receive: Blocking receive implemented by
       timeout or threads. Non-blocking receive proceeds while waiting for
       message. Message is queued(BUFFERED) upon arrival.

                          Intro to Distributed Systems
                                   Middleware                             42
Reliability issues
Unreliable communication
  Best effort, No ACK’s or retransmissions
  Application programmer designs own reliability
Reliable communication
  Different degrees of reliability
  Processes have some guarantee that messages will
   be delivered.
  Reliability mechanisms - ACKs, NACKs.

                    Intro to Distributed Systems
                             Middleware               43
Reliability issues
Unreliable communication
  Best effort, No ACK’s or retransmissions
  Application programmer designs own reliability
Reliable communication
  Different degrees of reliability
  Processes have some guarantee that messages will
   be delivered.
  Reliability mechanisms - ACKs, NACKs.

                    Intro to Distributed Systems
                             Middleware               44
Distributed Shared Memory
Abstraction used for processes on machines that
 do not share memory
  Motivated by shared memory multiprocessors that do
   share memory
Processes read and write from virtual shared
  Primitives - read and write
  OS ensures that all processes see all updates
Caching on local node for efficiency
  Issue - cache consistency
                    Intro to Distributed Systems
                             Middleware             45
Remote Procedure Call
 Builds on message passing
   extend traditional procedure call to perform transfer of control
    and data across network
   Easy to use - fits well with the client/server model.
   Helps programmer focus on the application instead of the
    communication protocol.
   Server is a collection of exported procedures on some shared
   Variety of RPC semantics
       “maybe call”
       “at least once call”
       “at most once call”

                         Intro to Distributed Systems
                                  Middleware                           46
Fault Models in Distributed
Crash failures
  A processor experiences a crash failure when it
   ceases to operate at some point without any warning.
   Failure may not be detectable by other processors.
     Failstop - processor fails by halting; detectable by
      other processors.
Byzantine failures
  completely unconstrained failures
  conservative, worst-case assumption for behavior of
   hardware and software
  covers the possibility of intelligent (human) intrusion.

                     Intro to Distributed Systems
                              Middleware                     47
Other Fault Models in
Distributed Systems
Dealing with message loss
  Crash + Link
     Processor fails by halting. Link fails by losing
      messages but does not delay, duplicate or corrupt
  Receive Omission
     processor receives only a subset of messages sent to
  Send Omission
     processor fails by transmitting only a subset of the
      messages it actually attempts to send.
  General Omission
     Receive and/or send omission

                     Intro to Distributed Systems
                              Middleware                     48
Other distributed system
Concurrency and Synchronization
Distributed Deadlocks
Time in distributed systems
  improve availability and performance
  of processes and data
  eavesdropping, masquerading, message tampering,
                   Intro to Distributed Systems
                            Middleware               49
Traditional Systems -
Client/Server Computing

Client/server computing allocates application
 processing between the client and server
A typical application has three basic
  Presentation logic
  Application logic
  Data management logic

                  Intro to Distributed Systems
                           Middleware            50
Client/Server Models
There are at least three different models for
 distributing these functions:
  Presentation logic module running on the client
   system and the other two modules running on one or
   more servers.
  Presentation logic and application logic modules
   running on the client system and the data
   management logic module running on one or more
  Presentation logic and a part of application logic
   module running on the client system and the other
   part(s) of the application logic module and data
   management module running on one or more servers
                   Intro to Distributed Systems
                            Middleware              51
Distributed Systems
 Enables the modular interconnection of distributed
  software (typically via services)
    abstract over low level mechanisms used to
     implement resource management services.
 Computational Model
    Support separation of concerns and reuse of services
 Customizable, Composable Middleware Frameworks
    Provide for dynamic network and system
     customizations, dynamic
     invocation/revocation/installation of services.
    Concurrent execution of multiple distributed systems
                   Intro to Distributed Systems
                            Middleware                  52
Modularity via Middleware

                Application Program

     API                API                      API
   Middleware         Middleware               Middleware
    Service 1          Service 2                Service 3

                Intro to Distributed Systems
                         Middleware                         53
Useful Middleware Services
 Naming and Directory Service
 State Capture Service
 Event Service
 Transaction Service
 Fault Detection Service
 Trading Service
 Replication Service
 Migration Service

                  Intro to Distributed Systems
                           Middleware            54
Types of Middleware Services
Integrated Sets of Services -- DCE
Domain Specific Integration frameworks
Distributed Object Frameworks
Component services and frameworks
  Provide a specific function to the requestor
  Generally independent of other services
  Presentation, Communication, Control, Information
   Services, computation services etc.
Web-Service Based Frameworks
                   Intro to Distributed Systems
                            Middleware                 55
Integrated Sets Middleware
An Integrated set of services consist of a set of
 services that take significant advantage of each
Example: DCE

                   Intro to Distributed Systems
                            Middleware               56
Distributed Computing
Environment (DCE)
DCE is from the Open Software Foundation
 (OSF), and now X/Open, offers an environment
 that spans multiple architectures, protocols, and
 operating systems.
  DCE supported by major software vendors.
It provides key distributed technologies,
 including RPC, a distributed naming service, time
 synchronization service, a distributed file system,
 a network security service, and a threads
                   Intro to Distributed Systems
                            Middleware            57

  DCE          DCE Distributed File Service
 Security    DCE          DCE
                                     Other Basic
 Service Distributed   Directory
          Time Service   Service
               DCE Remote Procedure Calls

                  DCE Threads Services

            Operating System Transport Services
                    Intro to Distributed Systems
                             Middleware                         58
Integration Frameworks
Integration frameworks are integration
 environments that are tailored to the needs of a
 specific application domain.
  Workgroup framework - for workgroup computing.
  Transaction Processing monitor frameworks
  Network management frameworks

                  Intro to Distributed Systems
                           Middleware               59
Distributed Object Computing
Combining distributed computing with an object
  Allows software reusability
  More abstract level of programming
  The use of a broker like entity or bus that keeps track
   of processes, provides messaging between processes
   and other higher level services
     JINI, EJB, J2EE
     .NET, E-SPEAK
                    Intro procedure-oriented distributed
     Note: DCE uses a to Distributed Systems
                            Middleware                     60
      systems model, not an object model.
Issues with Distributed
 Partial failure

                    Intro to Distributed Systems
                             Middleware            61
Techniques for object
 Message Passing
    Object knows about network; Network data is
 Argument/Return Passing
    Like RPC. Network data = args + return result +
 Serializing and Sending Object
    Actual object code is sent. Might require
     synchronization. Network data = object code + object
     state + sync info
 Shared Memory
    based on DSM implementation
                  = Data touched +
    Network Data Intro to Distributed Systems synchronization info
                            Middleware                            62
CORBA is a standard specification for developing
 object-oriented applications.
CORBA was defined by OMG in 1990.
OMG is dedicated to popularizing Object-
 Oriented standards for integrating applications
 based on existing standards.

                  Intro to Distributed Systems
                           Middleware            63
The Object Management
Architecture (OMA)

   Application                                  Common
    Objects                                     facilities

                 Object Request

                 Object Services

                 Intro to Distributed Systems
                          Middleware                         64
ORB: the communication hub for all objects in
 the system
Object Services: object events, persistent
 objects, etc.
Common facilities: accessing databases,
 printing files, etc.
Application objects: document handling

                Intro to Distributed Systems
                         Middleware            65
Distributed Object Models
Combine techniques
  Object Oriented Programming
     Encapsulation, modularity
     Separation of concerns
     Increased efficiency of algorithms
     Use objects as the basis
     Build network-enabled applications
     Objects on different machines/platforms
Objects and Threads
C++ Model
  Objects and threads are tangentially related
  Non-threaded program has one main thread of
     Pthreads (POSIX threads)
        • Invoke by giving a function pointer to any function in
          the system
        • Threads mostly lack awareness of OOP ideas and
        • Partially due to the hybrid nature of C++?
Objects and Threads
Java Model
  Objects and threads are separate entities
     Threads are objects in themselves
     Can be joined together (complex object implements
        • BUT: Properties of connection between object and
          thread are not well-defined or understood
Java and Concurrency
Java has a passive object model
  Objects, threads separate entities
     Primitive control over interactions
  Synchronization capabilities also primitive
     “Synchronized keyword” guarantees safety but not
     Deadlock is easy to create
     Fair scheduling is not an option
COOP Applications
Three kinds of concurrent problem solving
  Pipeline Concurrency
     Start, split up problem, compute solutions, check
  Divide & Conquer
     Start, split up problem, compute solutions, combine
      solutions (Product of a large vector of numbers)
  Cooperative problem solving
     Start, split up problem, problem solvers communicate
      during problem-solving to exchange state, partial
      results (complex simulations)
Fundamentals of Distributed
Concurrent object oriented languages
Goal: Merge parallelism and OOP
  Parallelism gives "naturalness" in algorithm design +
  OOP gives modularity + safety
Provide modeling, simulation capabilities
The Actor Model

                   A Model of Distributed Objects

                                        Interface   Threa
                  e                                             Procedure
  d                          Messages

             Procedure                       Interface


The Actor Model
Actor system - collection of independent agents
 interacting via message passing
     Acquaintances - initial, created, acquired
     History Sensitive
     Asynchronous communication
An actor can do one of three things:
     Create a new actor and initialize its behavior
     Send a message to an existing actor
     Change its local state or behavior
Actor Primitives
Three actor primitives
  Send_to(message, actor)
State change specified by replacement behaviors
ABCM: Applications
Symbolic and numerical distributed algorithms
Symbolic algorithms include:
   Theorem proving
   Truth maintenance
   Production systems
   Language parsing
-Found to be useful for distributed artificial
   Implemented in CommonLisp
   Provides most of the same features of Lisp
ABCM: Object Model
Objects are
  Data members
  Methods to operate on those members
  Methods for message exchange/passing
No shared memory
  All communication through message passing
Each object has a thread of control like Actors
ABCM: Object Model
Object Model
  Upon receiving a message, the object will do one of
   four things:
     More message passing
     Creation of new objects
     Reference and update member variables
     Various operations (arithmetic, list processing) on
      values stored in local memory and passed in
ABCM: Object Model
Each object has an incoming buffer
  Buffers assumed infinite
     No blocking send
     Can send any time
  Messages are put in buffer in the order they arrive
     No global clock (more later)
     “Channels” determine ordering of messages (more
ABCM: Object Model
Object is always in one of three modes
  Dormant (initial state)
     Waiting to get hit by a message that matches one of
      its activation patterns
     Got a message with the appropriate pattern
     Cannot accept new messages in this state
     Returns to dormant when done processing
     Waiting for a specific type/pattern of message to
     In waiting mode, an acceptable message can "cut to
      the front of the line" ahead of other messages that
      don't match the pattern
ABCM: Message Passing
 No Broadcasting
    You must know the name of the recipients of a message
 Objects always "know about" themselves
    They may acquire and forget knowledge about other objects as
     time goes on
 Asynchrony
    Any object can send a message to any other object at any time
 Guaranteed Arrival, Buffered Communication
    Guaranteed delivery in finite time, buffers are infinite, no blocking
 Incoming buffers are in order of arrival
 Channel-like behavior along connections.
 No global clock.
    Unrelated events take place "concurrently."
ABCM: Message Passing
Three types of message passing:
     Objects send message and don't wait for reply
     Synchronous RPC
     Object sends a message and waits for the response
      before continuing.
     Asynchronous RPC
     Object sends a message, gets back a token, checks
      result later.
ABCM: Message Passing
Two modes:
  Ordinary mode
    Object cannot be interrrupted while in active mode.
    "Nonpreemptive multitasking"
  Express Mode
    Messages sent in express mode can interrupt active
    Can break some of the math behind the model
    Only one level of interrupts
    Can mark a set of statements "atomic" so they aren't
    Can do a breaking interrupt (break the operation
     going on when express message got received)
       • DB query that gets cancelled
ABCM: Conclusion
Lays foundation for many other distributed
 object systems
  Some aspects CORBA-like (synchronous RPC)
  Some aspects not (asynchronous RPC, interrupts)
  Active objects will become important later

To top