Sie sind auf Seite 1von 45

Persistent and Transient

Objects
Persistentobjectscontinuetoexistevenif
theyarentintheaddressspaceofaserver
process
Transientobjectsexistencedependson
havingaserver
Binding a Client to an Object

UnlikeRPC,distributedobjectshave
systemwideobjectreferences
Thesystemmaysupporteitherimplicit
bindingorexplicitbinding
TheobjectreferencemaycontainIP
address,port,objectname
Orusealocationserversoweneedonly
addressforthisserverplustheobjectname
Binding a Client to an Object

Distr_object* obj_ref; //Declare a systemwide object reference


obj_ref = ; // Initialize the reference to a distributed object
obj_ref-> do_something(); // Implicitly bind and invoke a method
(a)
Distr_object objPref; //Declare a systemwide object reference
Local_object* obj_ptr; //Declare a pointer to local objects
obj_ref = ; //Initialize the reference to a distributed object
obj_ptr = bind(obj_ref); //Explicitly bind and obtain a pointer to the local
proxy
obj_ptr -> do_something(); //Invoke a method on the local proxy
(b)

a) (a)Examplewithimplicitbindingusingonlyglobalreferences
b) (b)Examplewithexplicitbindingusingglobalandlocalreferences
Parameter Passing

Sincewehavesystemwideobjectrefs,we
donthavethesametypesofproblemswe
hadwithRPCsandpointers
However,forperformancemotiveswemay
wanttotreatobjectrefparameters
differentlydependingonwheretheobject
resides
Parameter Passing

Thesituationwhenpassinganobjectbyreferenceorby
value.
2-18
Java RMI

Javaoffersremoteobjectsastheonlytype
ofdistributedobject
Onedifferencebetweenlocalandremote
objectsisthatsynchronizedmethodswork
differentlyonthetwotypes
Blockingappliesonlytotheproxiesofthe
remoteobjects
AparameterpassedtoanRMImustbe
serializable
Message-Oriented
Communication
NeitherRPCnorRMIworkswhenwecant
assurethatthereceivingsideisntexecuting
Wecanusemessaginginthiscase
Message-Oriented Communication

Generalorganizationofacommunicationsysteminwhich
hostsareconnectedthroughanetwork
2-20
Messaging Modes

Messagingsystemscanbeeitherpersistent
ortransient
Aremessagesretainedwhenthesendersand/or
receiversstopexecuting?
Canalsobeeithersynchronousor
asynchronous
Blockingvs.nonblocking
Persistent Communication

Persistentcommunicationoflettersbackinthedaysofthe
PonyExpress.
Persistence and Synchronicity in
Communication

a) Persistentasynchronouscommunication
b) Persistentsynchronouscommunication

2-22.1
Persistence and Synchronicity in
Communication

2-22.2

c) Transientasynchronouscommunication
d) Receiptbasedtransientsynchronouscommunication
Persistence and Synchronicity in
Communication

e) Deliverybasedtransientsynchronouscommunicationatmessagedelivery
f) Responsebasedtransientsynchronouscommunication
Message-Oriented Transient
Communication
Socketsareanexampleofmessageoriented
transientcommunication
TheMessagePassingInterface(MPI)isa
newersetofmessageorientedprimitives
formulticomputers
MPIcommunicationtakesplacewithina
knowngroupofprocesses
A(groupID,processID)pairuniquelyidentifiesa
sourceordestinationofamessage
The Message-Passing
Interface (MPI)
Someofthemostintuitivemessagepassingprimitivesof
MPI.
Primitive Meaning

MPI_bsend Append outgoing message to a local send buffer


Send a message and wait until copied to local or remote
MPI_send
buffer
MPI_ssend Send a message and wait until receipt starts

MPI_sendrecv Send a message and wait for reply

MPI_isend Pass reference to outgoing message, and continue


Pass reference to outgoing message, and wait until receipt
MPI_issend
starts
MPI_recv Receive a message; block if there are none

MPI_irecv Check if there is an incoming message, but do not block


Message-Oriented Persistent
Communication
Knownasmessagequeuingsystemsor
MessageOrientedMiddleware(MOM)
Supportpersistentasynchronous
communication
Generallyhaveslowcommunications
Similartoemailsystems
Basicmodelapplicationscommunicateby
insertingmessagesinspecificqueues
Message-Queuing Model
Fourcombinationsforlooselycoupledcommunications
usingqueues.

2-26
Message-Queuing Model

Basicinterfacetoaqueueinamessagequeuingsystem.

Primitive Meaning
Put Append a message to a specified queue
Block until the specified queue is nonempty, and remove the first
Get
message
Check a specified queue for messages, and remove the first.
Poll
Never block.
Install a handler to be called when a message is put into the
Notify
specified queue.
General Architecture of a Message-Queuing
System

Messagesareinsertedintoalocalsource
queue
Themessagecontainsthenameofadestination
queue
Themessagequeuingsystemtransfers
messagestothedestinationqueue
Useadbwhichmapsqueuenamestonetwork
locations
General Architecture of a Message-Queuing
System

Queuesaremanagedbyqueuemanagers
Specialqueuemanagersactasrelayswhich
forwardmessagestoothermanagers
General Architecture of a Message-Queuing
System

Therelationshipbetweenqueueleveladdressingand
networkleveladdressing.
General Architecture of a Message-Queuing
System
Thegeneralorganizationofamessagequeuingsystem
withrouters.

2-29
Message Brokers

Messagequeuingsystemscanbeusedto
integrateexistingandnewapplications
Thesediverseapplicationshavedifferent
messageformats
Sincewehaveoldapps,cantuseastandard
messageformat
Sousemessagebrokerswhichconvert
messagesfromoneformattoanother
Message Brokers

2-30

Thegeneralorganizationofamessagebrokerina
messagequeuing
system.
Example: IBM MQSeries

IBMMQSeriesisusedtointegrateoldapps
(generallyrunningonIBMmainframes)
Queuesaremanagedbyqueuemanagers
Queuemanagersareconnectedthroughmessage
channels
Eachofthetwoendsofthemessagechannelis
managedbyamessagechannelagents(MCA)
Queuemanagerscanbelinkedintothesame
processastheapplicationusingthequeue
QueuemanagersimplementedusingRPC
Example: IBM MQSeries

GeneralorganizationofIBM'sMQSeriesmessagequeuing
system.
2-31
Channels

Someattributesassociatedwithmessagechannelagents.

Attribute Description
Transport type Determines the transport protocol to be used
Indicates that messages are to be delivered in the order they
FIFO delivery
are sent
Message
Maximum length of a single message
length
Setup retry Specifies maximum number of retries to start up the remote
count MCA
Delivery Maximum times MCA will try to put received message into
retries queue
Aliases

Inordertobeabletochangethenameofa
queuemanagerortoreplaceitwithanother
withouthavingtorecompileallofthe
applicationswhichsendmessagestoit,
localaliasesareusedforqueuemanager
names.
Message Transfer

ThegeneralorganizationofanMQSeriesqueuingnetwork
usingroutingtablesandaliases.
Message Transfer

Primitive Description
MQopen Open a (possibly remote) queue
MQclose Close a queue
MQput Put a message into an opened queue
MQget Get a message from a (local) queue

PrimitivesavailableinanIBMMQSeriesMQI
Stream-Oriented
Communication
Multimediasystemsusestreamoriented
communications
Thetimingofthedatadeliveryiscriticalin
suchsystems
Suchcommunicationisusedforcontinuous
mediasuchasaudiowherethetemporal
relationshipsbetweendifferentdataitemsare
meaningfulasopposedtodiscretemediasuch
astext
Stream-Oriented
Communication
Datastreamshaveseveralmodes
Asynchronoustransmissionmodeplacesno
timingconstraintsonthedataitemsinastream
Synchronoustransmissionmodegivesa
maximumendtoenddelayforeachitemina
datastream
Isochronoustransmissionmodegivesboth
maximumandminimumdelays
Boundedjitter
Stream-Oriented
Communication
Streamscanbeeithersimpleorcomplex
(withseveralrelatedsimplesubstreams)
Relatedsubstreamswillneedtobe
synchronized
Streamscanbebeseenasachannel
betweenasourceandasink
Sourcecouldbeafileormultimediacapture
device
Sinkcouldbeafileormultimediarendering
device
Data Stream

Settingupastreambetweentwoprocessesacrossa
network.
Data Stream

Settingupastreamdirectlybetweentwodevices.

2-35.2
Data Stream

Anexampleofmulticastingastreamtoseveralreceivers.
Streams and QoS

Timedependentrequirementsaregenerally
expressedasQualityofService(QoS)
requirements
Theunderlyingdistributedsystemandnetwork
mustensurethatthesearemet
Wecanexpresssuchrequirementsusingaflow
specification
Partridgesmodelusesatokenbucket
algorithm
Specifying QoS

Characteristics of the Input Service Required

maximum data unit size Loss sensitivity (bytes)


(bytes) Loss interval (sec)
Token bucket rate (bytes/sec) Burst loss sensitivity (data
Token bucket size (bytes) units)
Maximum transmission rate Minimum delay noticed (sec)
(bytes/sec) Maximum delay variation
(sec)
Quality of guarantee

Aflowspecification.
Specifying QoS

Theprincipleofatokenbucketalgorithm.
Setting up a Stream

Beforeastreamisopenedbetweensourceand
sinkresourcesthroughthenetworkmustbe
reservedinordertomeettheQoSrequirements
Bandwidth
Buffers
Processingcapability
Figuringouthowmuchofeachisrequiredisdifficult
sincetheyarentspecifieddirectlyintheQoS
RSVPisaprotocolforenablingresourcereservations
innetworkrouters
Setting Up a Stream

ThebasicorganizationofRSVPforresourcereservationin
adistributed
system.
Stream Synchronization

Animportantissueisthatdifferentstreams
(possiblysubstreamsofacomplexstream)
mustbesynchronized
Continuouswithdiscrete
Continuouswithcontinuous(moredifficult)
Differentlevelsofgranularityforsyncing
requireddependingonsituation
Synchronization Mechanisms

Synchronizationcanbecarriedoutbythe
application
Canalsobesuppliedbyamiddlewarelayer
Complexstreamsaremultiplexedaccording
toagivensynchronizationspecification
(e.g.MPEG)
Syncingcanoccureitheratthesendingor
receivingend.
Synchronization Mechanisms

Theprincipleofexplicitsynchronizationonthelevelof
dataunits.
Synchronization Mechanisms
Theprincipleofsynchronizationassupportedbyhigh
levelinterfaces.

2-41

Das könnte Ihnen auch gefallen