src/worker.cc
// Memory fill work loop. Execute until alloted pages filled.
Memory fill work loop. Execute until alloted pages filled.
Memory fill work loop . Execute until alloted pages filled .
bool FillThread::Work() {
  bool result = true;
  logprintf(9, "Log: Starting fill thread %d\n", thread_num_);
  struct page_entry pe;
  int64 loops = 0;
  while (IsReadyToRun() && (loops < num_pages_to_fill_)) {
    result = result && sat_->GetEmpty(&pe);
    if (!result) {
      logprintf(0, "Process Error: fill_thread failed to pop pages, "
                "bailing\n");
      break;
    }
    result = result && FillPageRandom(&pe);
    if (!result) break;
    result = result && sat_->PutValid(&pe);
    if (!result) {
      logprintf(0, "Process Error: fill_thread failed to push pages, "
                "bailing\n");
      break;
    }
    loops++;
  }
  pages_copied_ = loops;
  status_ = result;
  logprintf(9, "Log: Completed %d: Fill thread. Status %d, %d pages filled\n",
            thread_num_, status_, pages_copied_);
  return result;
}
bool FillThread :: Work ( ) { bool result = true ; logprintf ( 9 , " \n " , thread_num_ ) ; struct page_entry pe ; int64 loops = 0 ; while ( IsReadyToRun ( ) && ( loops < num_pages_to_fill_ ) ) { result = result && sat_ -> GetEmpty ( & pe ) ; if ( ! result ) { logprintf ( 0 , " " " \n " ) ; break ; } result = result && FillPageRandom ( & pe ) ; if ( ! result ) break ; result = result && sat_ -> PutValid ( & pe ) ; if ( ! result ) { logprintf ( 0 , " " " \n " ) ; break ; } loops ++ ; } pages_copied_ = loops ; status_ = result ; logprintf ( 9 , " \n " , thread_num_ , status_ , pages_copied_ ) ; return result ; }
Memory fill work loop.
Memory fill work loop .
// We want to fill num_pages_to_fill pages, and // stop when we've filled that many. // We also want to capture early break // Fill the page with pattern // Put the page back on the queue. // Fill in thread status.