00001 00002 #include "pose.h" 00003 00005 void adapt::Step() 00006 { 00007 Event *ev; 00008 POSE_TimeType lastGVT = localPVT->getGVT(); 00009 int iter=0; 00010 00011 rbFlag = 0; 00012 if (!parent->cancels.IsEmpty()) CancelUnexecutedEvents(); 00013 if (eq->RBevent) Rollback(); 00014 if (!parent->cancels.IsEmpty()) CancelEvents(); 00015 parent->Status(); 00016 00017 if (rbFlag) timeLeash = pose_config.min_leash; 00018 else if (timeLeash < pose_config.max_leash) timeLeash += pose_config.leash_flex; //expand spec window 00019 // Shorten the leash as we near POSE_endtime 00020 if ((POSE_endtime > POSE_UnsetTS) && (lastGVT + timeLeash > POSE_endtime)) 00021 timeLeash = POSE_endtime - lastGVT + 1; 00022 00023 // Prepare to execute an event 00024 ev = eq->currentPtr; 00025 while ((ev->timestamp >= 0) && (ev->timestamp <= lastGVT + timeLeash)) { 00026 // do all events within speculative window 00027 currentEvent = ev; 00028 ev->done = 2; 00029 parent->ResolveFn(ev->fnIdx, ev->msg); // execute it 00030 ev->done = 1; // complete the event execution 00031 eq->mem_usage++; 00032 eq->ShiftEvent(); // shift to next event 00033 ev = eq->currentPtr; 00034 iter++; 00035 } 00036 #if !CMK_TRACE_DISABLED 00037 if(pose_config.stats) 00038 if (iter > 0) localStats->Loop(); 00039 #endif 00040 } 00041