|
Blender V5.0
|
#include <task.h>
Classes | |
| struct | Summary |
Public Member Functions | |
| TaskPool (const TaskPoolType type, const eTaskPriority priority, void *userdata) | |
| ~TaskPool () | |
| TaskPool (TaskPool &&other)=delete | |
| TaskPool (const TaskPool &other)=delete | |
| TaskPool & | operator= (const TaskPool &other)=delete |
| TaskPool & | operator= (TaskPool &&other)=delete |
| void | task_push (TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata) |
| void | work_and_wait () |
| void | cancel () |
| bool | current_canceled () |
| TaskPool () | |
| ~TaskPool () | |
| void | push (TaskRunFunction &&task) |
| void | wait_work (Summary *stats=nullptr) |
| void | cancel () |
Static Public Member Functions | |
| static bool | canceled () |
Public Attributes | |
| TaskPoolType | type |
| bool | use_threads |
| void * | userdata |
| volatile bool | is_suspended = false |
| blender::Vector< Task > | suspended_tasks |
| ListBase | background_threads |
| ThreadQueue * | background_queue |
| volatile bool | background_is_canceling = false |
| eTaskPriority | priority |
Protected Attributes | |
| tbb::task_group | tbb_group |
| double | start_time |
| int | num_tasks_pushed |
Definition at line 157 of file task_pool.cc.
|
inline |
Definition at line 177 of file task_pool.cc.
References BLI_task_scheduler_num_threads(), BLI_thread_queue_init(), BLI_threadpool_init(), priority, TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, type, use_threads, and userdata.
Referenced by operator=(), operator=(), TaskPool(), and TaskPool().
|
inline |
Definition at line 213 of file task_pool.cc.
References BLI_thread_queue_free(), BLI_threadpool_end(), TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, and type.
|
delete |
References TaskPool().
|
delete |
References TaskPool().
| CCL_NAMESPACE_BEGIN TaskPool::TaskPool | ( | ) |
Definition at line 14 of file task.cpp.
References num_tasks_pushed, start_time, and time_dt().
| TaskPool::~TaskPool | ( | ) |
| void TaskPool::cancel | ( | ) |
|
inline |
Cancel all tasks, keep worker threads running.
Definition at line 290 of file task_pool.cc.
References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.
Referenced by BLI_task_pool_cancel().
|
inline |
Definition at line 305 of file task_pool.cc.
References BLI_assert_msg, TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.
Referenced by BLI_task_pool_current_canceled().
References TaskPool().
References TaskPool().
| void TaskPool::push | ( | TaskRunFunction && | task | ) |
Definition at line 21 of file task.cpp.
References num_tasks_pushed, and tbb_group.
Referenced by ImageManager::device_load_builtin(), Integrator::device_update(), GeometryManager::device_update_displacement_images(), GeometryManager::device_update_volume_images(), TEST(), and TEST().
|
inline |
Create and add a new task to the pool.
Definition at line 251 of file task_pool.cc.
References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.
Referenced by BLI_task_pool_push().
Definition at line 27 of file task.cpp.
References TaskPool::Summary::num_tasks_handled, num_tasks_pushed, start_time, tbb_group, time_dt(), and TaskPool::Summary::time_total.
Referenced by ImageManager::device_load_builtin(), ImageManager::device_update(), Integrator::device_update(), GeometryManager::device_update_displacement_images(), GeometryManager::device_update_volume_images(), TEST(), and TEST().
|
inline |
Work and wait until all tasks are done.
Definition at line 272 of file task_pool.cc.
References TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, and TASK_POOL_TBB_SUSPENDED.
Referenced by BLI_task_pool_work_and_wait().
| volatile bool TaskPool::background_is_canceling = false |
Definition at line 173 of file task_pool.cc.
| ThreadQueue* TaskPool::background_queue |
Definition at line 172 of file task_pool.cc.
| ListBase TaskPool::background_threads |
Definition at line 171 of file task_pool.cc.
| volatile bool TaskPool::is_suspended = false |
Definition at line 167 of file task_pool.cc.
|
protected |
Definition at line 62 of file task.h.
Referenced by push(), TaskPool(), and wait_work().
| eTaskPriority TaskPool::priority |
Definition at line 175 of file task_pool.cc.
Referenced by TaskPool().
|
protected |
Definition at line 59 of file task.h.
Referenced by TaskPool(), and wait_work().
| blender::Vector<Task> TaskPool::suspended_tasks |
Definition at line 168 of file task_pool.cc.
|
protected |
Definition at line 54 of file task.h.
Referenced by push(), and wait_work().
| TaskPoolType TaskPool::type |
Definition at line 158 of file task_pool.cc.
Referenced by TaskPool(), and ~TaskPool().
| bool TaskPool::use_threads |
Definition at line 159 of file task_pool.cc.
Referenced by TaskPool().
| void* TaskPool::userdata |
Definition at line 161 of file task_pool.cc.
Referenced by BLI_task_pool_user_data(), and TaskPool().