MySQL 8.0.39
Source Code Documentation
resourcegroups::platform Namespace Reference

Typedefs

using cpu_id_t = uint32_t
 

Functions

bool is_platform_supported ()
 Check if platform supports binding CPUS to thread. More...
 
bool bind_to_cpu (cpu_id_t cpu_id)
 Bind current thread to run on CPU cpu_id. More...
 
bool bind_to_cpu (cpu_id_t cpu_id, my_thread_os_id_t thread_id)
 Bind thread specified by thread_id to run on CPU cpu_id. More...
 
bool bind_to_cpus (const std::vector< cpu_id_t > &cpu_ids)
 Bind current thread to run on the list of CPUS specified in cpu_ids. More...
 
bool bind_to_cpus (const std::vector< cpu_id_t > &cpu_ids, my_thread_os_id_t thread_id)
 Bind thread specified by thread_id to run on list of CPUs specified by cpu_ids. More...
 
bool unbind_thread ()
 Unbind current thread to run on all CPUs. More...
 
bool unbind_thread (my_thread_os_id_t thread_id)
 Unbind thread specified by thread_id to run on all CPUs. More...
 
int thread_priority (my_thread_os_id_t thread_id)
 Get priority of thread specified by thread_id. More...
 
bool set_thread_priority (int priority)
 Set priority of current thread. More...
 
bool set_thread_priority (int priority, my_thread_os_id_t thread_id)
 Set priority of thread specified by thread_id. More...
 
uint32_t num_vcpus_using_affinity ()
 Find number of VCPUs as seen by the current process based on the affinity between each process and VCPU. More...
 
uint32_t num_vcpus_using_config ()
 Get the number of VCPUS based on system configuration. More...
 
uint32_t num_vcpus ()
 Get the number of VCPU. More...
 
bool can_thread_priority_be_set ()
 Check if thread priority setting is allowed on the platform or not. More...
 
bool is_valid_thread_priority (int priority)
 Check if thread priority value is valid. More...
 
int min_thread_priority_value ()
 Get the minimum priority value. More...
 
int max_thread_priority_value ()
 Get the maximum priority value. More...
 
int thread_priority ()
 
static int map_to_win_priority (int priority)
 

Typedef Documentation

◆ cpu_id_t

using resourcegroups::platform::cpu_id_t = typedef uint32_t

Function Documentation

◆ bind_to_cpu() [1/2]

bool resourcegroups::platform::bind_to_cpu ( cpu_id_t  cpu_id)

Bind current thread to run on CPU cpu_id.

Parameters
cpu_idID of the CPU.
Returns
false if binding was successful else true.

◆ bind_to_cpu() [2/2]

bool resourcegroups::platform::bind_to_cpu ( cpu_id_t  cpu_id,
my_thread_os_id_t  thread_id 
)

Bind thread specified by thread_id to run on CPU cpu_id.

Parameters
cpu_idID of CPU.
thread_idOS ID of the thread.
Returns
true if binding was unsuccessful else false.

◆ bind_to_cpus() [1/2]

bool resourcegroups::platform::bind_to_cpus ( const std::vector< cpu_id_t > &  cpu_ids)

Bind current thread to run on the list of CPUS specified in cpu_ids.

Parameters
cpu_idsList of CPU IDs to bind current thread.
Returns
false if binding was successful else true.

◆ bind_to_cpus() [2/2]

bool resourcegroups::platform::bind_to_cpus ( const std::vector< cpu_id_t > &  cpu_ids,
my_thread_os_id_t  thread_id 
)

Bind thread specified by thread_id to run on list of CPUs specified by cpu_ids.

Parameters
cpu_idsList of CPU IDs to bind the thread.
thread_idOS ID of thread.
Returns
false if binding was successful else true.

◆ can_thread_priority_be_set()

bool resourcegroups::platform::can_thread_priority_be_set ( )

Check if thread priority setting is allowed on the platform or not.

Returns
true if thread priority setting is allowed else false.

◆ is_platform_supported()

bool resourcegroups::platform::is_platform_supported ( )

Check if platform supports binding CPUS to thread.

Returns
true if platform supports CPU binding else false.

◆ is_valid_thread_priority()

bool resourcegroups::platform::is_valid_thread_priority ( int  priority)

Check if thread priority value is valid.

Returns
true if thread priority value is valid else false.

◆ map_to_win_priority()

static int resourcegroups::platform::map_to_win_priority ( int  priority)
inlinestatic

◆ max_thread_priority_value()

int resourcegroups::platform::max_thread_priority_value ( )

Get the maximum priority value.

Returns
int indicating max priority value.

◆ min_thread_priority_value()

int resourcegroups::platform::min_thread_priority_value ( )

Get the minimum priority value.

Returns
int indicating minimum priority value

◆ num_vcpus()

uint32_t resourcegroups::platform::num_vcpus ( )

Get the number of VCPU.

◆ num_vcpus_using_affinity()

uint32_t resourcegroups::platform::num_vcpus_using_affinity ( )

Find number of VCPUs as seen by the current process based on the affinity between each process and VCPU.

◆ num_vcpus_using_config()

uint32_t resourcegroups::platform::num_vcpus_using_config ( )

Get the number of VCPUS based on system configuration.

◆ set_thread_priority() [1/2]

bool resourcegroups::platform::set_thread_priority ( int  priority)

Set priority of current thread.

Parameters
priorityPriority to set to.
Returns
true if call was unsuccessful else false.

◆ set_thread_priority() [2/2]

bool resourcegroups::platform::set_thread_priority ( int  priority,
my_thread_os_id_t  thread_id 
)

Set priority of thread specified by thread_id.

Parameters
priorityPriority to set to.
thread_idOS ID of the thread.
Returns
true if call was unsuccessful else false.

◆ thread_priority() [1/2]

int resourcegroups::platform::thread_priority ( )

◆ thread_priority() [2/2]

int resourcegroups::platform::thread_priority ( my_thread_os_id_t  thread_id)

Get priority of thread specified by thread_id.

Parameters
thread_idOS ID of the thread.
Returns
an int indicating priority of the thread.

◆ unbind_thread() [1/2]

bool resourcegroups::platform::unbind_thread ( )

Unbind current thread to run on all CPUs.

Returns
true if unbind was unsuccessful else false.

◆ unbind_thread() [2/2]

bool resourcegroups::platform::unbind_thread ( my_thread_os_id_t  thread_id)

Unbind thread specified by thread_id to run on all CPUs.

Returns
true if unbind was unsuccessful else false.