Skip to main content
. Author manuscript; available in PMC: 2018 Jul 1.
Published in final edited form as: ACM Trans Model Comput Simul. 2017 Jul;27(2):7. doi: 10.1145/2987373

ALGORITHM 4.

Steps for roll-back triggered by a RB-message

Input: Roll-back time rbt, the RB-message rb
Output: the number of events recovered to LPEQ nRecovered
Search the latest valid state s prior to rbt with timestamp t1;
Recover LVT of this LP to t1, recover state to s;
nRecovered = 0;
for channel ch in input channel list do
  if ch == rb.channel then
    Remove all ordinary events with send time greater than or equal to rb.st in ch.ICEQ,
      ch.ICPQ, LPEQ and TEQ;
    Recover events with receive time greater than t1 to ch.ICEQ from ch.ICPQ;
    if ch.submit.strb.st & ch.ICEQ is not empty then
      Submit the smallest event in ch.ICEQ to LPEQ and update ch.submit;
      nRecovered++;
    end
  else
    Recover events with receive time greater than t1 to ch.ICEQ from ch.ICPQ;
  end
  if ch.ICEQ.head.rt < submit.rt then
    Submit the smallest event in ch.ICEQ to LPEQ and update ch.submit;
    nRecovered++;
  end
  if ch.scheduleHistoryLVT then
    Send a RB-message (RB_PRIORITY, LVT) to ch.neighbour;
    Set ch.scheduleHistory to LVT;
  end
end