scheduler.cc (13140:ecd8a58f3884) | scheduler.cc (13144:61e0f3230787) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 47 unchanged lines hidden (view full) --- 56 // clear themselves out after the scheduler goes away. 57 clear(); 58} 59 60void 61Scheduler::clear() 62{ 63 // Delta notifications. | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 47 unchanged lines hidden (view full) --- 56 // clear themselves out after the scheduler goes away. 57 clear(); 58} 59 60void 61Scheduler::clear() 62{ 63 // Delta notifications. |
64 for (auto &e: deltas) 65 e->deschedule(); 66 deltas.clear(); | 64 while (!deltas.empty()) 65 deltas.front()->deschedule(); |
67 68 // Timed notifications. 69 for (auto &tsp: timeSlots) { 70 TimeSlot *&ts = tsp.second; | 66 67 // Timed notifications. 68 for (auto &tsp: timeSlots) { 69 TimeSlot *&ts = tsp.second; |
71 for (auto &e: ts->events) 72 e->deschedule(); | 70 while (!ts->events.empty()) 71 ts->events.front()->deschedule(); |
73 deschedule(ts); 74 } 75 timeSlots.clear(); 76 77 // gem5 events. 78 if (readyEvent.scheduled()) 79 deschedule(&readyEvent); 80 if (pauseEvent.scheduled()) --- 29 unchanged lines hidden (view full) --- 110 for (Process *p = initList.getNext(); p; p = initList.getNext()) { 111 p->finalize(); 112 p->popListNode(); 113 p->ready(); 114 } 115 116 update(); 117 | 72 deschedule(ts); 73 } 74 timeSlots.clear(); 75 76 // gem5 events. 77 if (readyEvent.scheduled()) 78 deschedule(&readyEvent); 79 if (pauseEvent.scheduled()) --- 29 unchanged lines hidden (view full) --- 109 for (Process *p = initList.getNext(); p; p = initList.getNext()) { 110 p->finalize(); 111 p->popListNode(); 112 p->ready(); 113 } 114 115 update(); 116 |
118 for (auto &e: deltas) 119 e->run(); 120 deltas.clear(); | 117 while (!deltas.empty()) 118 deltas.front()->run(); |
121 122 for (auto ets: eventsToSchedule) 123 eq->schedule(ets.first, ets.second); 124 eventsToSchedule.clear(); 125 126 if (_started) { 127 if (!runToTime && starved()) 128 scheduleStarvationEvent(); --- 147 unchanged lines hidden (view full) --- 276 _numCycles++; 277 _changeStamp++; 278 } 279 280 // The update phase. 281 update(); 282 283 // The delta phase. | 119 120 for (auto ets: eventsToSchedule) 121 eq->schedule(ets.first, ets.second); 122 eventsToSchedule.clear(); 123 124 if (_started) { 125 if (!runToTime && starved()) 126 scheduleStarvationEvent(); --- 147 unchanged lines hidden (view full) --- 274 _numCycles++; 275 _changeStamp++; 276 } 277 278 // The update phase. 279 update(); 280 281 // The delta phase. |
284 for (auto &e: deltas) 285 e->run(); 286 deltas.clear(); | 282 while (!deltas.empty()) 283 deltas.front()->run(); |
287 288 if (!runToTime && starved()) 289 scheduleStarvationEvent(); 290 291 if (runOnce) 292 schedulePause(); 293} 294 --- 102 unchanged lines hidden --- | 284 285 if (!runToTime && starved()) 286 scheduleStarvationEvent(); 287 288 if (runOnce) 289 schedulePause(); 290} 291 --- 102 unchanged lines hidden --- |