src/worker.cc
// Workload for random disk thread.
Workload for random disk thread.
Workload for random disk thread .
bool RandomDiskThread::DoWork(int fd) {
  logprintf(11, "Log: Random phase for disk %s (thread %d).\n",
            device_name_.c_str(), thread_num_);
  while (IsReadyToRun()) {
    BlockData *block = block_table_->GetRandomBlock();
    if (block == NULL) {
      logprintf(12, "Log: No block available for device %s (thread %d).\n",
                device_name_.c_str(), thread_num_);
    } else {
      ValidateBlockOnDisk(fd, block);
      block_table_->ReleaseBlock(block);
      blocks_read_++;
    }
  }
  pages_copied_ = blocks_read_;
  return true;
}
bool RandomDiskThread :: DoWork ( int fd ) { logprintf ( 11 , " \n " , device_name_ . c_str ( ) , thread_num_ ) ; while ( IsReadyToRun ( ) ) { BlockData * block = block_table_ -> GetRandomBlock ( ) ; if ( block == NULL ) { logprintf ( 12 , " \n " , device_name_ . c_str ( ) , thread_num_ ) ; } else { ValidateBlockOnDisk ( fd , block ) ; block_table_ -> ReleaseBlock ( block ) ; blocks_read_ ++ ; } } pages_copied_ = blocks_read_ ; return true ; }
Workload for random disk thread.
Workload for random disk thread .