

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Maria Hybinette, UGA
Maria Hybinette, UGA
Time (wallclock time)
Simulator A
(tank)
Simulator B
(target)
āfireā
ātarget
destroyedā
Simulator C
(observer)
event
message
simulated world
the observer should
see the tank fire
before the target is
destroyed.
real world
! Intuition : The observer could āseeā the target is destroyed before the tank fired upon it!
! Temporal anomalies such as this may or may not be acceptable, depending on the federationās goals
! Correct ordering of events can be achieved by assigning a time stamp (logical time) to each event, and
ensuring events are delivered in time stamp order (e.g., using conservative or optimistic
synchronization)
Ā» This may entail significant computation/communication overheads
Maria Hybinette, UGA
Maria Hybinette, UGA
Definition (Lamport `78) āhappens beforeā relationship (! ):
Consider two actions (event, send, or deliver), A1 and A
! if A1 & A2 occur in the same process and A1 precedes A2 , then A1! A
! if A1 is a send, and A2 is a delivery of the same message, then A1! A
! if A1! A2 and A2! A3, then A1! A3 (transitivity)
Actions that are not causally related are said to be concurrent
Basic idea: If there is a left-to-right path from A1 to A2, then A1! A
wallclock time
Federate A
Federate B
E 1
E 2
1
4
Federate C
E 3
E 4
1
3
Maria Hybinette, UGA
Time (real-time)
Federate A
(tank 1)
Federate B
(tank 2)
Federate C
(observer)
fire event
destroyed
event
ādestroy messageā delayed
to preserve causal order
(fire is seen before destroyed)
! A message delivery service is said to be causally ordered if for any two
messages M1 and M2 sent to the same federate where M1 and M2 contain
notices for events E1 and E2, respectively, and E1! E2,
! then M1 is delivered to the federate before M
! Messages for concurrent events may be delivered in any order
Maria Hybinette, UGA
Maria Hybinette, UGA
Wallclock Time
Federate A
Federate B
Federate C
Dispatcher
Fire
Destroyed
Maria Hybinette, UGA
Assume reliable, ordered message delivery
Main loop in each simulator:
Wallclock Time
Federate A
Federate B
Federate C
Flush barrier
while( not done with simulation )
Deliver all events from RTI
Barrier
Process events, send messages
Flush barrier
Maria Hybinette, UGA
i
i
[i] = number of messages process i has sent to group
i [j] (j " i) = number of messages sent to group by process j that
have been delivered to process i (number of messages from j
causally preceding process iās current event)
Ā» Example: C 1
from process 3, and 4 messages from process 4
Ā» Increment C i
[i]
Ā» Use process iās vector clock as message time stamp
Ā» Indicates which messages causally precede this message
Maria Hybinette, UGA
R
[S] + 1, and / check this is the next message from S /
Ā» T[j]! C R
[j], all j " S, / messages preceding M already delivered /
Ā» / If T[j] < C R [j], R has received other messages from process j /
Deliver?
Yes
Clock =
Time stamp?
Deliver? No!
Deliver? Yes
Deliver?
Yes [1,0,0]
Deliver
Deliver [2,1,0]
Deliver
Maria Hybinette, UGA
Maria Hybinette, UGA
Time (real-time)
Federate A
(enemy aircraft 1)
Federate B
(enemy aircraft 2)
Federate C
(pilot 1)
attack aircraft 2
take off first
Federate D
(pilot 2)
take off second
attack aircraft 2