join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::ReactorThread Class Reference

Convenience class that owns a Reactor running on a dedicated background thread. More...

#include <reactor.hpp>

Static Public Member Functions

static Reactorreactor ()
 get the global Reactor instance.
 
static int affinity (int core)
 set reactor thread affinity.
 
static int affinity ()
 get reactor thread affinity.
 
static int priority (int prio)
 set reactor thread priority.
 
static int priority ()
 get reactor thread priority.
 
static pthread_t handle ()
 get the handle of the reactor thread.
 
static int mbind (int numa)
 bind command queue memory to a NUMA node.
 
static int mlock ()
 lock command queue memory in RAM.
 

Detailed Description

Convenience class that owns a Reactor running on a dedicated background thread.

Member Function Documentation

◆ affinity() [1/2]

int ReactorThread::affinity ( )
static

get reactor thread affinity.

Returns
affinity or -1 if not pinned.

◆ affinity() [2/2]

int ReactorThread::affinity ( int core)
static

set reactor thread affinity.

Parameters
corethread core affinity (-1 to disable pinning).
Returns
0 on success, -1 on failure.

◆ handle()

pthread_t ReactorThread::handle ( )
static

get the handle of the reactor thread.

Returns
reactor thread handle.

◆ mbind()

int ReactorThread::mbind ( int numa)
static

bind command queue memory to a NUMA node.

Parameters
numaNUMA node ID.
Returns
0 on success, -1 on failure.

◆ mlock()

int ReactorThread::mlock ( )
static

lock command queue memory in RAM.

Returns
0 on success, -1 on failure.

◆ priority() [1/2]

int ReactorThread::priority ( )
static

get reactor thread priority.

Returns
priority.

◆ priority() [2/2]

int ReactorThread::priority ( int prio)
static

set reactor thread priority.

Parameters
priothread priority (0 = SCHED_OTHER, 1-99 = SCHED_FIFO).
Returns
0 on success, -1 on failure.

◆ reactor()

Reactor * ReactorThread::reactor ( )
static

get the global Reactor instance.

Returns
reference to the singleton Reactor.

The documentation for this class was generated from the following files: