proxygen
folly::FallbackGetcpu< ThreadId > Struct Template Reference

#include <CacheLocality.h>

Static Public Member Functions

static int getcpu (unsigned *cpu, unsigned *node, void *)
 

Detailed Description

template<typename ThreadId>
struct folly::FallbackGetcpu< ThreadId >

A class that lazily binds a unique (for each implementation of Atom) identifier to a thread. This is a fallback mechanism for the access spreader if __vdso_getcpu can't be loaded

Definition at line 171 of file CacheLocality.h.

Member Function Documentation

template<typename ThreadId>
static int folly::FallbackGetcpu< ThreadId >::getcpu ( unsigned *  cpu,
unsigned *  node,
void *   
)
inlinestatic

Fills the thread id into the cpu and node out params (if they are non-null). This method is intended to act like getcpu when a fast-enough form of getcpu isn't available or isn't desired

Definition at line 175 of file CacheLocality.h.

References folly::pushmi::operators::get.

Referenced by folly::AccessSpreader< Atom >::pickGetcpuFunc(), and TEST().

175  {
176  auto id = ThreadId::get();
177  if (cpu) {
178  *cpu = id;
179  }
180  if (node) {
181  *node = id;
182  }
183  return 0;
184  }
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
Definition: submit.h:391

The documentation for this struct was generated from the following file: