MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / getCpuAffinity

Function getCpuAffinity

runtime/Util.h:105–112  ·  view source on GitHub ↗

* Returns the cpu affinity mask of the currently executing thread. The type * cpu_set_t encodes information about which cores the current thread is * permitted to run on. */

Source from the content-addressed store, hash-verified

103 * permitted to run on.
104 */
105static FORCE_INLINE
106cpu_set_t getCpuAffinity() {
107 cpu_set_t cpuset;
108
109 CPU_ZERO(&cpuset);
110 assert(sched_getaffinity(0, sizeof(cpuset), &cpuset) == 0);
111 return cpuset;
112}
113
114/**
115 * This function sets the allowable set of cores for the currently executing

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected