Changeset 1740 in Sophya for trunk/ArchTOIPipe


Ignore:
Timestamp:
Nov 9, 2001, 12:23:58 AM (24 years ago)
Author:
aubourg
Message:

une optim pour quand on n'a que des segmented

Location:
trunk/ArchTOIPipe/Kernel
Files:
4 edited

Legend:

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

    r1738 r1740  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toi.cc,v 1.7 2001-11-08 15:47:46 aubourg Exp $
     5// $Id: toi.cc,v 1.8 2001-11-08 23:23:58 aubourg Exp $
    66
    77#include "toiprocessor.h"
     
    3737  producer = NULL;
    3838  dbg = false;
     39  syncOldWay = true;
    3940}
    4041
  • trunk/ArchTOIPipe/Kernel/toi.h

    r1738 r1740  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: toi.h,v 1.9 2001-11-08 15:47:46 aubourg Exp $
     7// $Id: toi.h,v 1.10 2001-11-08 23:23:58 aubourg Exp $
    88
    99#ifndef TOI_H
     
    7373  string getName() const {return name;}
    7474
     75  bool needSyncOldWay() const {return syncOldWay;}
     76
    7577protected:
    7678  TOI*                  errorTOI;
     
    8991  vector<TOIProcessor*> consumers;
    9092  double                defaultValue;
    91  
     93  bool  syncOldWay;
     94
    9295#ifdef WITH_SOPHYA
    9396  /* l'interface va etre modifiee, NE PAS UTILISER
  • trunk/ArchTOIPipe/Kernel/toiprocessor.cc

    r1738 r1740  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toiprocessor.cc,v 1.13 2001-11-08 15:47:46 aubourg Exp $
     5// $Id: toiprocessor.cc,v 1.14 2001-11-08 23:23:58 aubourg Exp $
    66
    77#include "toiprocessor.h"
     
    311311double TOIProcessor::getData(int toiIndex, int i) {
    312312  TOI* toi = getInputTOI(toiIndex);
    313   toi->waitForData(i);
     313  if (toi->needSyncOldWay()) toi->waitForData(i); // seulement pour autre que segmented
     314  autoWontNeed(i);
    314315  return toi->getData(i);
    315316}
     
    318319{
    319320  TOI* toi = getInputTOI(toiIndex);
    320   toi->waitForData(i);
     321  if (toi->needSyncOldWay()) toi->waitForData(i); // seulement pour autre que segmented
    321322  toi->getData(i, data, flag);
    322323  return;
     
    359360
    360361void TOIProcessor::notify() {
    361   lock();
    362 /*  if (mutex.__m_lock.__status == 0) {
    363     cout << "wait without lock" << endl; abort();
    364   }*/
    365  
     362  lock(); 
    366363  pthread_cond_broadcast(&dataReady);
    367364  unlock();
     
    373370  toi->putData(i, value, flg);
    374371  autoWontNeed(i);
    375   notify();
     372  if (toi->needSyncOldWay())  notify(); // seulement pour non segmented
    376373}
    377374
  • trunk/ArchTOIPipe/Kernel/toisegment.cc

    r1738 r1740  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: toisegment.cc,v 1.14 2001-11-08 15:47:46 aubourg Exp $
     5// $Id: toisegment.cc,v 1.15 2001-11-08 23:23:58 aubourg Exp $
    66
    77#include "toisegment.h"
     
    3131  master = new MasterView(bufsz, maxseg, "");
    3232  setName("TOISegmented");
     33  syncOldWay = false;
    3334}
    3435
     
    3637  master = new MasterView(bufsz, maxseg, nm);
    3738  setName(nm);
     39  syncOldWay = false;
    3840}
    3941
     
    4244  master = new MasterView(bufsz, maxseg, nm);
    4345  setName(nm);
     46  syncOldWay = false;
    4447}
    4548
Note: See TracChangeset for help on using the changeset viewer.