Advanced Communication Among Distributed Objects - PowerPoint PPT Presentation

About This Presentation
Title:

Advanced Communication Among Distributed Objects

Description:

Callback from the server to client ... Cannot be issued using client stub ... Atomic. Avoid side-effects when a failure occurs. Transactions. At-least-once ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 19
Provided by: shangp
Learn more at: http://www.cs.iit.edu
Category:

less

Transcript and Presenter's Notes

Title: Advanced Communication Among Distributed Objects


1
Advanced Communication Among Distributed Objects
  • Outline
  • Request synchronization
  • Request multiplicity
  • Request reliability

2
Request Synchronization
  • Request synchronization
  • Synchronous
  • Wait for the results
  • Oneway
  • Do not expect any results or exceptions
  • Request returns control to client as soon as the
    middleware accepts the request
  • Server and Client execute concurrently
  • Deferred synchronous
  • Dynamic
  • Explicit request object
  • Invoke more than one concurrent operations with
    single thread
  • Asynchronous
  • Callback from the server to client
  • Non-synchronous requests can be achieved by
    synchronous requests and multi-threading
  • COBRA provide direct support for all 4 different
    requests

3
Oneway Request
  • Using thread
  • Spawn a child thread to make synchronous request
  • Terminate the child thread once the request is
    finished
  • Performance penalty

4
Oneway Request
Class PrintSquas static void main(string
args) Team team Date date // initialization
.. OnewayReq a new OnewayReq (team,
date) a.start() // continue Class
OnewayReq extends Thread Team team Date
date OnewayReq (Team t, Date d) team t date
d public void run() team.print(date) //
call remote method
5
Oneway Request
  • Using thread
  • Spawn a child thread to make synchronous request
  • Terminate the child thread once the request is
    finished
  • Performance penalty
  • CORBA
  • Static and dynamic invocation support oneway
    request
  • IDL defines oneway operations
  • Precondition
  • No out, or inout parameter
  • Viod return type
  • No type-specific exceptions
  • Static invocation, Server decides this
    synchronization scheme
  • Dynamic invocation, client can choose oneway
    request (review the Request object, send
    operation.)

6
Oneway Request
  • CORBA
  • IDL defines oneway operations
  • Static invocation, Server decides this
    synchronization scheme
  • Dynamic invocation, client can choose oneway
    request

interface Team oneway void mail_timetable (in
Date date)
Server
Client
r create_request()
rRequest
send_oneway
Op()
delete()
7
Oneway Request
  • Comparison
  • Thread
  • Less efficient (Create/delete thread)
  • IDL (oneway)
  • Less flexible
  • Type safe
  • DII
  • Flexible using different flag with send
  • Type unsafe
  • Less efficient (Create/delete request object)

8
Deferred Request
  • Using thread
  • Spawn a child thread to make synchronous request
  • Wait for termination of the child request thread
  • Obtain the result
  • Performance penalty

9
Deferred Request --- Using Thread
  • class PrintSquad
  • public void print (Team team, Date date)
  • DefsyncReqPrintSquad a new
    DefSyncReqPrintSquad (team, date)
  • // do something here.
  • a.join(this) // wait for request thread to die
  • System.out.println(a.getResult())
  • class DefSyncReqPrintSquad extends Thread
  • DefsyncReqPrintSquad (Team t, Date d)
  • Public String getResult()
  • Public void run()
  • strings
  • s team.asString(date) // call remote method
    and die

10
Deferred Request
  • CORBA
  • Only dynamic invocation interface support
    deferred synchronous request
  • Cannot be issued using client stub
  • get_response no-wait returns control back to
    client with indication if the result is ready

Server
Client
r create_request()
rRequest
send_defeered()
Op()
get_response()
delete()
11
Asynchronous Request
  • Using thread
  • Similar to deferred synchronous request
  • Request thread invokes a call back operation
  • Request thread join the main thread

12
Asynchronous Request --- Using Thread
  • Interface Callback
  • public void result (String s)
  • class PrintSquad implements Callback
  • public void print (Team team, Date date)
  • AsyncReqPrintSquad a new AsyncReqPrintSquad
    (team, date, this)
  • a.start()
  • // continue to do some work here
  • public void result (String s) // callback
  • System.out.println(s)
  • class AsyncReqPrintSquad extends Thread
  • Team team
  • Date date
  • Callback call

13
Asynchronous Request
  • CORBA

Server
Client
r create_request()
rRequest
send()
Op()
Callback ()
14
Asynchronous Request
  • Using Message Queues

Request Queue
enter
remove
Client
Server
remove
enter
Reply Queue
15
Request Multiplicity
  • Request multiplicity
  • Unicast (from one client to one server)
  • Group request
  • same operations from multiple server objects
  • Group requests are anonymous
  • Group composition is managed by a channel
  • Group membership is unknown to the request
    producer
  • Group members are request consumers
  • Multiple request
  • Different operations from different server
    objects that are known to the client
  • Requested operations are independent with each
    other with no precedence relation
  • Client can collect results as they become
    available

16
Request Multiplicity
  • Implementing group request
  • Channel (Example 7.5)
  • CORBA Event channel (Example 7.6)
  • Implementing multiple request
  • Thread
  • Tuple space (Example 7.8)
  • Out
  • In (blocking call)
  • Rd (blocking call)
  • Performance and development overhead
  • DII (Example 7.9)

17
Request Reliability
  • Unicast Request Reliability
  • Exactly-once
  • Highest reliability
  • Depends on middleware, fault-tolerant, hardware,
    os platforms
  • Expensive
  • Atomic
  • Avoid side-effects when a failure occurs
  • Transactions
  • At-least-once
  • Middleware guarantees the execution
  • Multiple execution of a single request due to
    reply lose
  • If request modify servers state, this semantics
    is not desirable
  • At-most-once
  • If not executed, errors are raised
  • Maybe
  • No guarantee of execution
  • Client doesnt know the failure
  • Oneway request in CORBA

18
Request Reliability
  • Group and Multiple Request Reliability
  • K-reliability
  • Totally ordered
  • Best effort
  • Trade off between performance and Reliability
Write a Comment
User Comments (0)
About PowerShow.com