Changeset 2133 in Sophya
- Timestamp:
- Jul 26, 2002, 10:52:43 AM (23 years ago)
- Location:
- trunk/ArchTOIPipe/Kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toimanager.cc
r2077 r2133 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toimanager.cc,v 1.1 5 2002-06-18 21:15:19 ansariExp $5 // $Id: toimanager.cc,v 1.16 2002-07-26 08:52:43 vfebvre Exp $ 6 6 7 7 #include "toimanager.h" … … 27 27 } 28 28 29 // enregistrement d'un processeur dans la liste des processeurs pour une execution en groupe 30 31 void TOIManager::registerProcessor(TOIProcessor* proc) { 32 33 cout << "Adding processor to TOIManager for group execution" << endl; 34 processors.push_back(proc); 35 36 } 37 38 39 // demarrage de tous les processeurs 40 41 void TOIManager::startAll() { 42 for (vector<TOIProcessor*>::iterator i = processors.begin(); 43 i != processors.end(); i++) { 44 TOIProcessor* proc = *i; 45 cout << "******************" << endl; 46 cout << "starting processor " << endl; 47 cout << "******************" << endl; 48 proc->start(); 49 cout << "processor started " << endl; 50 cout << "******************" << endl; 51 } 52 } 53 54 55 29 56 void TOIManager::setRequestedSample(int begin, int end) { 30 57 reqBegin = begin; … … 46 73 47 74 void TOIManager::joinAll() { 75 waitForAll(); 76 } 77 78 void TOIManager::waitForAll() { 48 79 for (vector<pthread_t*>::iterator i = threads.begin(); 49 80 i != threads.end(); i++) { -
trunk/ArchTOIPipe/Kernel/toimanager.h
r2000 r2133 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toimanager.h,v 1.1 3 2002-05-14 13:06:57 ansariExp $7 // $Id: toimanager.h,v 1.14 2002-07-26 08:52:43 vfebvre Exp $ 8 8 9 9 … … 15 15 #include <vector> 16 16 17 #include "toiprocessor.h" 18 17 19 using namespace std; 18 20 … … 23 25 int getRequestedBegin(); 24 26 int getRequestedEnd(); 25 void addThread(pthread_t*);26 void joinAll();27 27 28 void startAll(); 29 void waitForAll(); 30 31 void joinAll(); // deprecated. Use waitForAll(); 32 28 33 protected: 29 34 TOIManager(); … … 33 38 34 39 vector<pthread_t*> threads; 40 void addThread(pthread_t*); 41 42 vector<TOIProcessor*> processors; 43 void registerProcessor(TOIProcessor* proc); 44 45 46 friend class TOIProcessor; 35 47 }; 36 48 … … 69 81 #endif 70 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 -
trunk/ArchTOIPipe/Kernel/toiprocessor.cc
r2026 r2133 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toiprocessor.cc,v 1.2 4 2002-05-30 11:51:26 ansariExp $5 // $Id: toiprocessor.cc,v 1.25 2002-07-26 08:52:43 vfebvre Exp $ 6 6 7 7 #include "toiprocessor.h" 8 8 #include "toimanager.h" 9 9 #include <pthread.h> 10 10 #include <typeinfo> // ajout pour linux 11 11 #ifdef HAVE_VALUES_H 12 12 #include <values.h> … … 28 28 29 29 #define pthread_mutexattr_setkind_np pthread_mutexattr_settype 30 30 31 31 32 TOIProcessor::TOIProcessor() { … … 45 46 wontNeedValue = -1; 46 47 47 } 48 // Pour referencer un TOIProcessor, il faut recuperer le TOIManager correspondant 49 TOIManager::getManager()->registerProcessor(this); 50 51 } 52 53 48 54 49 55 TOIProcessor::~TOIProcessor() { … … 440 446 */ 441 447 448 449 450 451 452 453 454 455
Note:
See TracChangeset
for help on using the changeset viewer.