|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
线程池实现 更多...
#include "NeForce/core/async/lazy_thread.hpp"#include "NeForce/core/async/packaged_task.hpp"#include "NeForce/core/async/timer.hpp"#include "NeForce/core/container/priority_queue.hpp"#include "NeForce/core/container/unordered_map.hpp"#include "NeForce/core/time/datetime.hpp"#include "NeForce/core/utility/optional.hpp"类 | |
| struct | task_group |
| 任务组 更多... | |
| class | local_queue |
| 线程本地任务队列 更多... | |
| struct | worker_context |
| 工作线程上下文 更多... | |
| struct | task_info |
| 任务信息 更多... | |
| struct | submit_result< T > |
| 任务提交结果 更多... | |
| class | thread_pool |
| 线程池类 更多... | |
| struct | thread_pool::periodic_task_state |
| 周期性任务状态 更多... | |
| struct | thread_pool::pool_statistics |
| 线程池统计信息 更多... | |
函数 | |
| NEFORCE_API worker_context *& | get_worker_context () noexcept |
| 获取当前线程的工作线程上下文 | |
| NEFORCE_API shared_ptr< task_group > & | get_current_task_group () noexcept |
| 获取当前线程的任务组 | |
线程池实现
此文件提供了高性能线程池的实现,支持任务提交、优先级调度、任务窃取、 延迟任务和周期性任务等功能。线程池支持固定模式和缓存模式两种运行方式。
在文件 thread_pool.hpp 中定义.