MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / set_current_thread_affinity

Function set_current_thread_affinity

deps/jemalloc/src/background_thread.c:81–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static inline bool
82set_current_thread_affinity(int cpu) {
83#if defined(JEMALLOC_HAVE_SCHED_SETAFFINITY)
84 cpu_set_t cpuset;
85 CPU_ZERO(&cpuset);
86 CPU_SET(cpu, &cpuset);
87 int ret = sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
88
89 return (ret != 0);
90#else
91 return false;
92#endif
93}
94
95/* Threshold for determining when to wake up the background thread. */
96#define BACKGROUND_THREAD_NPAGES_THRESHOLD UINT64_C(1024)

Callers 1

background_thread_entryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected