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

optim locks fits

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.