Changeset 1773 in Sophya
- Timestamp:
- Nov 16, 2001, 3:10:43 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/Kernel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toiprocessor.cc
r1762 r1773 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toiprocessor.cc,v 1. 19 2001-11-13 16:22:47aubourg Exp $5 // $Id: toiprocessor.cc,v 1.20 2001-11-16 14:10:42 aubourg Exp $ 6 6 7 7 #include "toiprocessor.h" … … 373 373 void TOIProcessor::autoWontNeed(int iCur) { 374 374 if (neededHistory <=0) return; 375 if (iCur < lastAWN + neededHistory ) return;375 if (iCur < lastAWN + neededHistory/10) return; 376 376 lastAWN = iCur; 377 377 // cout << name << " wontNeedBefore " << iCur-neededHistory << endl; -
trunk/ArchTOIPipe/Kernel/toisegment.cc
r1763 r1773 3 3 // Christophe Magneville 4 4 // Reza Ansari 5 // $Id: toisegment.cc,v 1.2 2 2001-11-14 13:45:39aubourg Exp $5 // $Id: toisegment.cc,v 1.23 2001-11-16 14:10:43 aubourg Exp $ 6 6 7 7 #include "toisegment.h" … … 240 240 firstNeeded = -1; 241 241 waiting = false; 242 waitingFor = -1; 242 243 } 243 244 … … 295 296 pthread_mutex_lock(&(master->read_wait_mutex)); 296 297 while (sn0<0 || sn >= sn0 + segmentSize*segments.size()) { 297 wait( ); // must be atomic with loop test // $CHECK$ est-ce vrai ?298 wait(sn); // must be atomic with loop test // $CHECK$ est-ce vrai ? 298 299 pthread_mutex_unlock(&(master->read_wait_mutex)); 299 300 LOG(cout << master->name << " BufferView " << hex << this << dec << ": waiting for " << sn << endl) … … 313 314 } 314 315 315 void TOISegmented::BufferView::wait( ) { /* reader thread, master read wait lock taken */316 void TOISegmented::BufferView::wait(int sn) { /* reader thread, master read wait lock taken */ 316 317 //pthread_mutex_lock(&(master->read_wait_mutex)); 317 318 waiting = true; 319 waitingFor = sn; 318 320 master->waitingViews++; 319 321 pthread_cond_wait(&(master->read_wait_condv), &(master->read_wait_mutex)); 320 322 waiting = false; 323 waitingFor = -1; 321 324 master->waitingViews--; 322 325 //pthread_mutex_unlock(&(master->read_wait_mutex)); -
trunk/ArchTOIPipe/Kernel/toisegment.h
r1766 r1773 5 5 // Christophe Magneville 6 6 // Reza Ansari 7 // $Id: toisegment.h,v 1.1 4 2001-11-14 14:49:05aubourg Exp $7 // $Id: toisegment.h,v 1.15 2001-11-16 14:10:43 aubourg Exp $ 8 8 9 9 #ifndef TOISEGMENT_H … … 180 180 181 181 bool waiting; 182 int waitingFor; 182 183 183 184 friend class MasterView;
Note:
See TracChangeset
for help on using the changeset viewer.