41 #ifndef _framescheduler_h
42 #define _framescheduler_h
46 #if !defined(SWIG) || defined(SWIG_THREADING) // Do not read when in swig and not in the threading module
55 #ifdef MEZZ_USEBARRIERSEACHFRAME
66 class MonopolyWorkUnit;
161 #ifdef MEZZ_USEBARRIERSEACHFRAME
177 #ifdef MEZZ_USEATOMICSTODECACHECOMPLETEWORK
182 Int32 DecacheAffinity;
214 void CleanUpThreads();
217 void DeleteThreads();
221 void UpdateDependentGraph(
const std::vector<WorkUnitKey> &Units);
225 void UpdateWorkUnitKeys(std::vector<WorkUnitKey> &Units);
237 std::fstream* _LogDestination = 0,
246 std::ostream* _LogDestination,
260 virtual void AddWorkUnitMain(
iWorkUnit* MoreWork,
const String& WorkUnitName);
265 virtual void AddWorkUnitAffinity(
iWorkUnit* MoreWork,
const String& WorkUnitName);
276 virtual void SortWorkUnitsMain(
bool UpdateDependentGraph_ =
true);
282 virtual void SortWorkUnitsAffinity(
bool UpdateDependentGraph_ =
true);
288 virtual void SortWorkUnitsAll(
bool UpdateDependentGraph_ =
true);
297 virtual void RemoveWorkUnitMain(
iWorkUnit* LessWork);
301 virtual void RemoveWorkUnitAffinity(
iWorkUnit* LessWork);
314 virtual Whole GetDependentCountOf(
iWorkUnit *Work,
bool UsedCachedDepedentGraph=
false);
324 virtual iWorkUnit* GetNextWorkUnitAffinity();
328 virtual bool AreAllWorkUnitsComplete();
333 virtual void UpdateDependentGraph();
340 virtual Whole GetFrameCount()
const;
344 virtual Whole GetFrameLength()
const;
354 virtual void SetFrameRate(
const Whole& FrameRate);
358 virtual void SetFrameLength(
const Whole& FrameLength);
362 virtual Whole GetThreadCount();
367 virtual void SetThreadCount(
const Whole& NewThreadCount);
371 virtual MaxInt GetCurrentFrameStart()
const;
379 Whole GetLastPauseTime()
const;
387 Whole GetLastFrameTime()
const;
411 virtual void DoOneFrame();
422 virtual void RunAllMonopolies();
447 virtual void CreateThreads();
462 virtual void RunMainThreadWork();
473 void JoinAllThreads();
483 virtual void ResetAllWorkUnits();
495 void WaitUntilNextFrame();
504 Whole GetWorkUnitMonopolyCount()
const;
508 Whole GetWorkUnitAffinityCount()
const;
512 Whole GetWorkUnitMainCount()
const;
543 void DependenciesChanged(
bool Changed=
true);
547 void LogDependencies();
552 std::ostream& GetLog();