MySQL 9.1.0
Source Code Documentation
resourcegroups::Thread_resource_control Class Reference

Class that abstracts the resource control that can be applied to threads. More...

#include <thread_resource_control.h>

Public Member Functions

 Thread_resource_control ()
 Default constructor. More...
 
int priority () const
 Get priority associated with Thread resource control object. More...
 
void set_priority (int priority)
 Set priority associated with Thread resource control object. More...
 
const std::vector< Range > & vcpu_vector () const
 Get const pointer of vector of CPU ID range. More...
 
void set_vcpu_vector (const std::vector< Range > &vcpu_vector)
 Set the CPU ID range vector. More...
 
bool apply_control ()
 Apply the thread resource controls to the thread on which this function is called. More...
 
bool apply_control (my_thread_os_id_t thread_os_id)
 Apply the thread resource controls to thread identified by the thread os id. More...
 
bool validate (const Type &resource_group_type) const
 Validate the CPU ID Ranges and thread priority value associate with the thread resource control object. More...
 

Private Attributes

std::vector< Rangem_vcpu_vector
 Vector of CPU ID range. More...
 
int m_priority
 Thread priority value. More...
 

Detailed Description

Class that abstracts the resource control that can be applied to threads.

The resource controls include set of CPU IDS which determine the CPUS the thread is allowed to run and the thread priority.

Constructor & Destructor Documentation

◆ Thread_resource_control()

resourcegroups::Thread_resource_control::Thread_resource_control ( )
inline

Default constructor.

Member Function Documentation

◆ apply_control() [1/2]

bool resourcegroups::Thread_resource_control::apply_control ( )

Apply the thread resource controls to the thread on which this function is called.

Returns
false if control application is successful else true

◆ apply_control() [2/2]

bool resourcegroups::Thread_resource_control::apply_control ( my_thread_os_id_t  thread_os_id)

Apply the thread resource controls to thread identified by the thread os id.

Parameters
thread_os_idThread OS ID.
Returns
false if control application is successful else true

◆ priority()

int resourcegroups::Thread_resource_control::priority ( ) const
inline

Get priority associated with Thread resource control object.

Returns
an int value indicating the thread priority.

◆ set_priority()

void resourcegroups::Thread_resource_control::set_priority ( int  priority)
inline

Set priority associated with Thread resource control object.

◆ set_vcpu_vector()

void resourcegroups::Thread_resource_control::set_vcpu_vector ( const std::vector< Range > &  vcpu_vector)
inline

Set the CPU ID range vector.

◆ validate()

bool resourcegroups::Thread_resource_control::validate ( const Type resource_group_type) const

Validate the CPU ID Ranges and thread priority value associate with the thread resource control object.

Returns
false if validation is successful else true.

◆ vcpu_vector()

const std::vector< Range > & resourcegroups::Thread_resource_control::vcpu_vector ( ) const
inline

Get const pointer of vector of CPU ID range.

Returns
pointer to vector of CPU ID range.

Member Data Documentation

◆ m_priority

int resourcegroups::Thread_resource_control::m_priority
private

Thread priority value.

◆ m_vcpu_vector

std::vector<Range> resourcegroups::Thread_resource_control::m_vcpu_vector
private

Vector of CPU ID range.


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