00001 /* 00002 * This file is part of openMask © INRIA, CNRS, Universite de Rennes 1 1993-2002, thereinafter the Software 00003 * 00004 * The Software has been developped within the Siames Project. 00005 * INRIA, the University of Rennes 1 and CNRS jointly hold intellectual property rights 00006 * 00007 * The Software has been registered with the Agence pour la Protection des 00008 * Programmes (APP) under registration number IDDN.FR.001.510008.00.S.P.2001.000.41200 00009 * 00010 * This file may be distributed under the terms of the Q Public License 00011 * version 1.0 as defined by Trolltech AS of Norway and appearing in the file 00012 * LICENSE.QPL included in the packaging of this file. 00013 * 00014 * Licensees holding valid specific licenses issued by INRIA, CNRS or Université de Rennes 1 00015 * for the software may use this file in accordance with that specific license 00016 * 00017 */ 00018 #ifndef PsnMultiThreadedSchedulerHEADER 00019 #define PsnMultiThreadedSchedulerHEADER 00020 00021 #include "PsnBenchScheduler.h" 00022 #include <pthread.h> 00023 #include <map> 00024 #include <vector> 00025 00026 class PsnFrameScheduler ; 00027 class PsnBarrier ; 00028 00034 class PsnMultiThreadedBenchmarkingScheduler : public PsnScheduler 00035 { 00036 public: 00042 PsnMultiThreadedBenchmarkingScheduler(unsigned int numberOfSteps, 00043 unsigned int numberOfThreads, 00044 bool createThreadAndLocalSchedulers, 00045 const int & indiceEchantillon, 00046 unsigned int _numberOfSamples, 00047 ostream & outputFile ) ; 00048 00049 00051 virtual ~PsnMultiThreadedBenchmarkingScheduler() ; 00052 00054 virtual void addToScheduable (PsnReferenceObjectHandle * ref, unsigned int when) ; 00055 00057 virtual void addToScheduable (PsnReferenceObjectHandle * ref, unsigned int when, unsigned int whichThread) ; 00058 00060 virtual void removeFromScheduable (PsnReferenceObjectHandle * ref) ; 00061 00063 virtual void schedule(PsnReferenceObjectHandle * ref) ; 00064 00066 virtual void unschedule(PsnReferenceObjectHandle * ref) ; 00067 00069 virtual void runStep (unsigned int which) ; 00070 00072 virtual void run ( unsigned int whichFrameScheduler ) ; 00073 00074 protected: 00076 static void * _threadContainer ( void * ) ; 00077 00079 unsigned int _currentStep ; 00080 00082 unsigned int _numberOfThreads ; 00083 00085 vector <PsnScheduler * > * _localSchedulers ; 00086 00088 PsnScheduler * _duplicatedObjectScheduler ; 00089 00091 PsnBarrier * _barrier ; 00092 00094 unsigned int _nextThreadForScheduling ; 00095 00097 map<PsnReferenceObjectHandle *, unsigned int> _whichThread ; 00098 00100 pthread_t * _threadIds ; 00101 00103 vector <pair<PsnScheduler *, unsigned int> * > * _threadData ; 00104 00106 long * * _localWaitingTimes ; 00107 00109 int _numberOfSamples ; 00110 00111 map<PsnReferenceObjectHandle *, long*> _tabVitesse; 00112 00113 const int & _sampleIndex; 00114 00115 ostream & _outputFile ; 00116 }; 00117 00118 #endif
| Documentation generated on Mon Nov 25 15:25:01 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |