CpuYield Class Reference

#include <cpuyield.h>

Inheritance diagram for CpuYield:

公共成员函数

  CpuYield (const void *res=nullptr)
  ~CpuYield ()
void  重置 ()
void  Pause ()

静态公共成员函数

static void  Wait ( Int cnt)

Static Private Member Functions

static void  _mm_pause ()

Additional Inherited Members

-  Protected Types inherited from CpuYieldState
using  SwitchDelegate = void(*)( CpuYieldState *state, const void *resource)
-  Protected Attributes inherited from CpuYieldState
Int32   _count
Int32   _loopSize
const void *  _resource
-  Static Protected Attributes inherited from CpuYieldState
static const Int   LOOPS_START_COUNT
static const Int   LOOPS_MAX_GRANULARITY
static const Int   LOOPS_BEFORE_YIELD
static const Int   LOOPS_BEFORE_SLEEP
static const UInt   LOCK_ACQUIRE
static const UInt   LOCK_SPIN
static const UInt   LOCK_RELEASE
static const UInt   MAX_STATE_ENUM

构造函数 & 析构函数文档编制

◆  CpuYield()

CpuYield ( const void *  res = nullptr )
explicit
参数
[in] res The contended resource because of which Pause might have to be called. Might be a nullptr (but shouldn't).

◆  ~CpuYield()

~ CpuYield ( )

成员函数文档编制

◆  Reset()

void Reset ( )

◆  Pause()

void Pause ( )

Pauses a little while until the contended resource hopefully becomes available again. Depending on the number of calls this will either just do a light spin loop or it might put the thread to sleep. Furthermore offending threads might be logged to diagnose deadlocks or bad performance.

◆  Wait()

static void Wait ( Int   cnt )
static

◆  _mm_pause()

static void _mm_pause ( )
static private