Changeset 1696 in Sophya for trunk/ArchTOIPipe/Kernel


Ignore:
Timestamp:
Oct 15, 2001, 12:44:49 AM (24 years ago)
Author:
aubourg
Message:

optim locks fits

Location:
trunk/ArchTOIPipe/Kernel
Files:
2 edited

Legend:

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

    r1695 r1696  
    11#include "fitstoirdr.h"
    22#include "toimanager.h"
    3 
     3#include <sched.h>
    44
    55
     
    128128       << firstSn << endl;
    129129
     130  fits_lock();
    130131  for (int i=0; i<nrows; i++) {
    131132    int anyNul;
    132133    double y;
    133     fits_lock();
    134134    fits_read_col_dbl(fptr,1,i+1,1,1,0,&y,&anyNul,&fstatus);
    135     fits_unlock();
     135    //fits_unlock();
    136136    int sn = (int) (y+.1);
    137137    TOIManager* mgr = TOIManager::getManager();
     
    142142      int j = colsinput[k].first;
    143143      if ( !checkOutputTOIIndex(k) )  continue;  // Reza - Si TOI non connecte
    144       fits_lock();
     144      //      fits_lock();
    145145      fits_read_col_dbl(fptr,j+1,i+1,1,1,0,&y,&anyNul,&fstatus);
    146146      long flg = 0;
     
    148148        fits_read_col_lng(fptr,j+2,i+1,1,1,0,&flg,&anyNul,&fstatus);
    149149      }
     150      //      fits_unlock();
     151      putData(k, sn, y, flg);
     152    }
     153    if (i%50==0)  {
    150154      fits_unlock();
    151       putData(k, sn, y, flg);
     155      sched_yield();
     156      fits_lock();
    152157    }
    153158    totnscount++;
    154159  }
     160  fits_unlock();
    155161  cout << "reader done reading... " << pthread_self() << endl;
    156162}
  • trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc

    r1692 r1696  
    11#include "fitstoiwtr.h"
    22#include "toimanager.h"
    3 
     3#include <sched.h>
    44
    55
     
    131131      }
    132132      wontNeedBefore(sn);
    133       fits_lock();
    134133      //      if ((sn%2000 == 0) || (sn<snb+5))
    135134      //cout << " DBG-B-FitsWriter::run()" << sn << endl;
    136135      double xx = sn;
     136      fits_lock();
    137137      fits_write_col_dbl(fptr, 1, fitsLine, 1, 1, &xx, &fstatus);
    138138     
     
    150150      }
    151151      fits_unlock();
     152      if (fitsLine%50==0) {
     153        sched_yield();
     154      }
    152155      //           if ((sn%2000 == 0) || (sn<snb+5))
    153156      //        cout << " DBG-C-FitsWriter::run()" << sn << " line=" << fitsLine << endl;
Note: See TracChangeset for help on using the changeset viewer.