Changeset 2133 in Sophya for trunk/ArchTOIPipe


Ignore:
Timestamp:
Jul 26, 2002, 10:52:43 AM (23 years ago)
Author:
vfebvre
Message:

startAll sur TOIManager

Location:
trunk/ArchTOIPipe/Kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toimanager.cc

    r2077 r2133  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toimanager.cc,v 1.15 2002-06-18 21:15:19 ansari Exp $
     5// $Id: toimanager.cc,v 1.16 2002-07-26 08:52:43 vfebvre Exp $
    66
    77#include "toimanager.h"
     
    2727}
    2828
     29// enregistrement d'un processeur dans la liste des processeurs pour une execution en groupe
     30
     31void 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
     41void 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
    2956void TOIManager::setRequestedSample(int begin, int end) {
    3057  reqBegin = begin;
     
    4673
    4774void TOIManager::joinAll() {
     75  waitForAll();
     76}
     77
     78void TOIManager::waitForAll() {
    4879  for (vector<pthread_t*>::iterator i = threads.begin();
    4980       i != threads.end(); i++) {
  • trunk/ArchTOIPipe/Kernel/toimanager.h

    r2000 r2133  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toimanager.h,v 1.13 2002-05-14 13:06:57 ansari Exp $
     7// $Id: toimanager.h,v 1.14 2002-07-26 08:52:43 vfebvre Exp $
    88
    99
     
    1515#include <vector>
    1616
     17#include "toiprocessor.h"
     18
    1719using namespace std;
    1820
     
    2325  int getRequestedBegin();
    2426  int getRequestedEnd();
    25   void addThread(pthread_t*);
    26   void joinAll();
    2727 
     28  void startAll();
     29  void waitForAll();
     30
     31  void joinAll();  // deprecated. Use waitForAll();
     32   
    2833protected:
    2934  TOIManager();
     
    3338
    3439  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;
    3547};
    3648
     
    6981#endif
    7082
     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  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toiprocessor.cc,v 1.24 2002-05-30 11:51:26 ansari Exp $
     5// $Id: toiprocessor.cc,v 1.25 2002-07-26 08:52:43 vfebvre Exp $
    66
    77#include "toiprocessor.h"
    88#include "toimanager.h"
    99#include <pthread.h>
    10 
     10#include <typeinfo>        // ajout pour linux
    1111#ifdef HAVE_VALUES_H
    1212#include <values.h>
     
    2828
    2929#define pthread_mutexattr_setkind_np pthread_mutexattr_settype
     30
    3031
    3132TOIProcessor::TOIProcessor() {
     
    4546  wontNeedValue = -1;
    4647
    47 }
     48  // Pour referencer un TOIProcessor, il faut recuperer le TOIManager correspondant
     49  TOIManager::getManager()->registerProcessor(this);
     50
     51}
     52
     53
    4854
    4955TOIProcessor::~TOIProcessor() {
     
    440446*/
    441447
     448
     449
     450
     451
     452
     453
     454
     455
Note: See TracChangeset for help on using the changeset viewer.