cfs/src/perfutil/Util.cc
/**
 * This function pins the current thread to a unique core in the cpuset of the
 * current process. If called more times than the number of cores in the cpuset
 * of the current process, this function is a no-op.
 */
This function pins the current thread to a unique core in the cpuset of the
current process. If called more times than the number of cores in the cpuset
of the current process, this function is a no-op.
This function pins the current thread to a unique core in the cpuset of the current process . If called more times than the number of cores in the cpuset of the current process this function is a no - op .
void
pinAvailableCore() {
  static std::vector<int> cores = getAllUseableCores();
  static std::mutex coreAllocMutex;
  coreAllocMutex.lock();
  if (cores.empty()) {
    coreAllocMutex.unlock();
    return;
  }
  int coreId = cores.back();
  cores.pop_back();
  coreAllocMutex.unlock();
  pinThreadToCore(coreId);
}
void pinAvailableCore ( ) { static std :: vector < int > cores = getAllUseableCores ( ) ; static std :: mutex coreAllocMutex ; coreAllocMutex . lock ( ) ; if ( cores . empty ( ) ) { coreAllocMutex . unlock ( ) ; return ; } int coreId = cores . back ( ) ; cores . pop_back ( ) ; coreAllocMutex . unlock ( ) ; pinThreadToCore ( coreId ) ; }
This function pins the current thread to a unique core in the cpuset of the
 current process.
This function pins the current thread to a unique core in the cpuset of the current process .