Changeset 41846
- Timestamp:
- Oct 17, 2021, 1:30:25 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ppStack.20211015/src/ppStackThread.c
r41841 r41846 19 19 thread->firstScan = 0; 20 20 thread->lastScan = 0; 21 thread->entry = -1; // this gets assigned after allocation 22 thread->status = PPSTACK_THREAD_NEW; 21 23 return thread; 22 24 } … … 124 126 readouts->data[j] = ro; 125 127 } 126 threads->data[i] = ppStackThreadAlloc(readouts); 128 ppStackThread *thread = ppStackThreadAlloc(readouts); 129 thread->entry = i; 130 threads->data[i] = thread; 127 131 psFree(readouts); // Drop reference 128 132 } … … 157 161 while (true) { 158 162 // check for any groups which can read data 163 // NOTE: threads->n is set (in ppStackThreadDataSetup) to be 1 more than the argument to -threads 159 164 for (int j = 0; j < threads->n; j++) { 160 165 ppStackThread *thread = threads->data[j]; 166 // fprintf (stderr, "grab thread %d, scan: %d - %d : busy: %d read: %d status: %d\n", thread->entry, thread->firstScan, thread->lastScan, thread->busy, thread->read, thread->status); 161 167 if (thread->read) { 162 168 continue; … … 166 172 thread->lastScan = stack->lastScan + rows; 167 173 stack->lastScan = thread->lastScan; 174 thread->status = PPSTACK_THREAD_READ; 168 175 169 176 psArray *readouts = thread->readouts; … … 172 179 173 180 psTrace("ppStack", 2, "Reading data for chunk %d into group %d....\n", numChunk, j); 181 // fprintf (stderr, "Reading data for chunk %d into group %d (thread %d, scan: %d - %d)....\n", numChunk, j, thread->entry, thread->firstScan, thread->lastScan); 174 182 for (int i = 0; i < readouts->n; i++) { 175 183 pmReadout *ro = readouts->data[i]; // Input readout … … 177 185 continue; 178 186 } 187 188 // fprintf (stderr, "read data for readout %d\n", i); 179 189 180 190 // override the recorded last scan … … 232 242 233 243 thread->read = thread->busy = true; 244 thread->status = PPSTACK_THREAD_RUN; 234 245 return thread; 235 246 } … … 239 250 for (int j = 0; j < threads->n; j++) { 240 251 ppStackThread *thread = threads->data[j]; 252 // fprintf (stderr, "test thread %d, scan: %d - %d : busy: %d, read: %d, status: %d\n", thread->entry, thread->firstScan, thread->lastScan, thread->busy, thread->read, thread->status); 253 241 254 if (thread->busy) { 242 255 continue; 243 256 } 257 thread->status = PPSTACK_THREAD_NEW; 244 258 thread->read = false; 245 259 wait = false;
Note:
See TracChangeset
for help on using the changeset viewer.
