线程池中实际使用的线程的基类,有以下关键成员: UAtomicQueue<UTask>* pool_task_queue_:存储当前线程待执行的普通任务; UAtomicPriorityQueue<UTask>* pool_priority_task_queue_:优先级队列的任务,仅辅助线程可以执行; CInt type_:表明当前线程是普通线程还是辅助线程 UThreadPoolConfigPtr config_:当前线程所属的线程池的配置 std::thread thread_:标准线程对象,实际执行UTask任务的载体
More...
#include <UThreadBase.h>
线程池中实际使用的线程的基类,有以下关键成员: UAtomicQueue<UTask>* pool_task_queue_:存储当前线程待执行的普通任务; UAtomicPriorityQueue<UTask>* pool_priority_task_queue_:优先级队列的任务,仅辅助线程可以执行; CInt type_:表明当前线程是普通线程还是辅助线程 UThreadPoolConfigPtr config_:当前线程所属的线程池的配置 std::thread thread_:标准线程对象,实际执行UTask任务的载体
◆ UThreadBase()
| UThreadBase::UThreadBase |
( |
| ) |
|
|
inlineexplicitprotected |
◆ ~UThreadBase()
| UThreadBase::~UThreadBase |
( |
| ) |
|
|
inlineoverrideprotected |
◆ calcPolicy()
| static CInt UThreadBase::calcPolicy |
( |
int |
policy | ) |
|
|
inlinestaticprivate |
设定计算线程调度策略信息, 非OTHER/RR/FIFO对应数值,统一返回OTHER类型
- Parameters
-
- Returns
◆ calcPriority()
| static CInt UThreadBase::calcPriority |
( |
int |
priority | ) |
|
|
inlinestaticprivate |
设定线程优先级信息 超过[min,max]范围,统一设置为min值
- Parameters
-
- Returns
◆ destroy()
|
|
inlineoverrideprotectedvirtual |
◆ loopProcess()
| CVoid UThreadBase::loopProcess |
( |
| ) |
|
|
inlineprotected |
◆ popPoolTask() [1/2]
从线程池的队列中中,按照指定的max_pool_batch_size_获取批量任务
- Parameters
-
- Returns
◆ popPoolTask() [2/2]
从线程池的队列中,获取任务
- Parameters
-
- Returns
◆ processTask()
| virtual CVoid UThreadBase::processTask |
( |
| ) |
|
|
protectedpure virtual |
◆ processTasks()
| virtual CVoid UThreadBase::processTasks |
( |
| ) |
|
|
protectedpure virtual |
◆ reset()
| CVoid UThreadBase::reset |
( |
| ) |
|
|
inlineprotected |
◆ runTask()
◆ runTasks()
◆ setAffinity()
| CVoid UThreadBase::setAffinity |
( |
int |
index | ) |
|
|
inlineprotected |
◆ setSchedParam()
| CVoid UThreadBase::setSchedParam |
( |
| ) |
|
|
inlineprotected |
◆ config_
◆ cv_
| std::condition_variable UThreadBase::cv_ |
|
protected |
◆ done_
◆ is_init_
| CBool UThreadBase::is_init_ |
|
protected |
◆ is_running_
| CBool UThreadBase::is_running_ |
|
protected |
◆ metrics_
◆ mutex_
| std::mutex UThreadBase::mutex_ |
|
protected |
◆ pool_priority_task_queue_
◆ pool_task_queue_
◆ thread_
| std::thread UThreadBase::thread_ |
|
protected |
◆ total_task_num_
| CULong UThreadBase::total_task_num_ = 0 |
|
protected |
◆ type_
| CInt UThreadBase::type_ = 0 |
|
protected |
The documentation for this class was generated from the following file: