|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | TaskParallelTLS |
| struct | TaskParallelSettings |
Functions | |
Task Scheduler | |
Central scheduler that holds running threads ready to execute tasks. A single queue holds the task from all pools. Initialize/exit must be called before/after any task pools are created/freed, and must be called from the main threads. All other scheduler and pool functions are thread-safe. | |
| void | BLI_task_scheduler_init (void) |
| void | BLI_task_scheduler_exit (void) |
| int | BLI_task_scheduler_num_threads (void) |
Task Isolation | |
Task isolation helps avoid unexpected task scheduling decisions that can lead to bugs if wrong assumptions were made. Typically that happens when doing "nested threading", i.e. one thread schedules a bunch of main-tasks and those spawn new sub-tasks. What can happen is that when a main-task waits for its sub-tasks to complete on other threads, another main-task is scheduled within the already running main-task. Generally, this is good, because it leads to better performance. However, sometimes code (often unintentionally) makes the assumption that at most one main-task runs on a thread at a time. The bugs often show themselves in two ways:
Task isolation can avoid these bugs by making sure that a main-task does not start executing another main-task while waiting for its sub-tasks. More precisely, a function that runs in an isolated region is only allowed to run sub-tasks that were spawned in the same isolated region. Unfortunately, incorrect use of task isolation can lead to deadlocks itself. This can happen when threading primitives are used that separate spawning tasks from executing them. The problem occurs when a task is spawned in one isolated region while the tasks are waited for in another isolated region. In this setup, the thread that is waiting for the spawned tasks to complete cannot run the tasks itself. On a single thread, that causes a deadlock already. When there are multiple threads, another thread will typically run the task and avoid the deadlock. However, if this situation happens on all threads at the same time, all threads will deadlock. This happened in #88598. | |
| void | BLI_task_isolate (void(*func)(void *userdata), void *userdata) |
Task Pool | |
Pool of tasks that will be executed by the central task scheduler. For each pool, we can wait for all tasks to be done, or cancel them before they are done. Running tasks may spawn new tasks. Pools may be nested, i.e. a thread running a task can create another task pool with smaller tasks. When other threads are busy they will continue working on their own tasks, if not they will join in, no new threads will be launched. | |
| enum | eTaskPriority { TASK_PRIORITY_LOW , TASK_PRIORITY_HIGH } |
| typedef enum eTaskPriority | eTaskPriority |
| typedef struct TaskPool | TaskPool |
| typedef void(* | TaskRunFunction) (TaskPool *__restrict pool, void *taskdata) |
| typedef void(* | TaskFreeFunction) (TaskPool *__restrict pool, void *taskdata) |
| TaskPool * | BLI_task_pool_create (void *userdata, eTaskPriority priority) |
| TaskPool * | BLI_task_pool_create_background (void *userdata, eTaskPriority priority) |
| TaskPool * | BLI_task_pool_create_background_serial (void *userdata, eTaskPriority priority) |
| TaskPool * | BLI_task_pool_create_suspended (void *userdata, eTaskPriority priority) |
| TaskPool * | BLI_task_pool_create_no_threads (void *userdata) |
| void | BLI_task_pool_free (TaskPool *pool) |
| void | BLI_task_pool_push (TaskPool *pool, TaskRunFunction run, void *taskdata, bool free_taskdata, TaskFreeFunction freedata) |
| void | BLI_task_pool_work_and_wait (TaskPool *pool) |
| void | BLI_task_pool_cancel (TaskPool *pool) |
| bool | BLI_task_pool_current_canceled (TaskPool *pool) |
| void * | BLI_task_pool_user_data (TaskPool *pool) |
| ThreadMutex * | BLI_task_pool_user_mutex (TaskPool *pool) |
Parallel for Routines | |
| typedef struct TaskParallelTLS | TaskParallelTLS |
| typedef void(* | TaskParallelRangeFunc) (void *__restrict userdata, int iter, const TaskParallelTLS *__restrict tls) |
| typedef void(* | TaskParallelInitFunc) (const void *__restrict userdata, void *__restrict chunk) |
| typedef void(* | TaskParallelReduceFunc) (const void *__restrict userdata, void *__restrict chunk_join, void *__restrict chunk) |
| typedef void(* | TaskParallelFreeFunc) (const void *__restrict userdata, void *__restrict chunk) |
| typedef struct TaskParallelSettings | TaskParallelSettings |
| typedef struct MempoolIterData | MempoolIterData |
| typedef void(* | TaskParallelMempoolFunc) (void *userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict tls) |
| BLI_INLINE void | BLI_parallel_range_settings_defaults (TaskParallelSettings *settings) |
| void | BLI_task_parallel_range (int start, int stop, void *userdata, TaskParallelRangeFunc func, const TaskParallelSettings *settings) |
| void | BLI_task_parallel_mempool (struct BLI_mempool *mempool, void *userdata, TaskParallelMempoolFunc func, const TaskParallelSettings *settings) |
| BLI_INLINE void | BLI_parallel_mempool_settings_defaults (TaskParallelSettings *settings) |
| int | BLI_task_parallel_thread_id (const TaskParallelTLS *tls) |
Task Graph Scheduling | |
Task Graphs can be used to create a forest of directional trees and schedule work to any tree. The nodes in the graph can be run in separate threads. +---- [root] ----+
| |
v v
[node_1] +---- [node_2] ----+
| |
v v
[node_3] [node_4]
TaskGraph *task_graph = BLI_task_graph_create();
BLI_task_graph_edge_create(root, node_1);
BLI_task_graph_edge_create(root, node_2);
BLI_task_graph_edge_create(node_2, node_3);
BLI_task_graph_edge_create(node_2, node_4);
struct TaskNode * BLI_task_graph_node_create(struct TaskGraph *task_graph, TaskGraphNodeRunFunction run, void *user_data, TaskGraphNodeFreeFunction free_func) Definition task_graph.cc:121 void BLI_task_graph_edge_create(struct TaskNode *from_node, struct TaskNode *to_node) Definition task_graph.cc:143 Definition task_graph.cc:25 Definition task_graph.cc:37 Any node can be triggered to start a chain of tasks. Normally you would trigger a root node but it is supported to start the chain of tasks anywhere in the forest or tree. When a node completes, the execution flow is forwarded via the created edges. When a child node has multiple parents the child node will be triggered once for each parent.
In this example After After scheduling work we need to wait until all the tasks have been finished.
When finished you can clean up all the resources by freeing the task_graph. Nodes are owned by the graph and are freed task_data will only be freed if a free_func was given.
Work can enter a tree on any node. Normally this would be the root_node. A Task-DataTypically you want give a task data to work on. Task data can be shared with other nodes, but be careful not to free the data multiple times. Task data is freed when calling BLI_task_graph_free. MyData *task_data = MEM_callocN(sizeof(MyData), __func__);
| |
| typedef void(* | TaskGraphNodeRunFunction) (void *__restrict task_data) |
| typedef void(* | TaskGraphNodeFreeFunction) (void *task_data) |
| struct TaskGraph * | BLI_task_graph_create (void) |
| void | BLI_task_graph_work_and_wait (struct TaskGraph *task_graph) |
| void | BLI_task_graph_free (struct TaskGraph *task_graph) |
| struct TaskNode * | BLI_task_graph_node_create (struct TaskGraph *task_graph, TaskGraphNodeRunFunction run, void *user_data, TaskGraphNodeFreeFunction free_func) |
| bool | BLI_task_graph_node_push_work (struct TaskNode *task_node) |
| void | BLI_task_graph_edge_create (struct TaskNode *from_node, struct TaskNode *to_node) |
| typedef enum eTaskPriority eTaskPriority |
| typedef struct MempoolIterData MempoolIterData |
Definition at line 209 of file BLI_task.h.
| typedef void(* TaskFreeFunction) (TaskPool *__restrict pool, void *taskdata) |
Definition at line 62 of file BLI_task.h.
| typedef void(* TaskGraphNodeFreeFunction) (void *task_data) |
Definition at line 325 of file BLI_task.h.
| typedef void(* TaskGraphNodeRunFunction) (void *__restrict task_data) |
Definition at line 324 of file BLI_task.h.
| typedef void(* TaskParallelFreeFunc) (const void *__restrict userdata, void *__restrict chunk) |
Definition at line 159 of file BLI_task.h.
| typedef void(* TaskParallelInitFunc) (const void *__restrict userdata, void *__restrict chunk) |
Definition at line 153 of file BLI_task.h.
| typedef void(* TaskParallelMempoolFunc) (void *userdata, MempoolIterData *iter, const TaskParallelTLS *__restrict tls) |
Definition at line 211 of file BLI_task.h.
| typedef void(* TaskParallelRangeFunc) (void *__restrict userdata, int iter, const TaskParallelTLS *__restrict tls) |
Definition at line 149 of file BLI_task.h.
| typedef void(* TaskParallelReduceFunc) (const void *__restrict userdata, void *__restrict chunk_join, void *__restrict chunk) |
Definition at line 155 of file BLI_task.h.
| typedef struct TaskParallelSettings TaskParallelSettings |
| typedef struct TaskParallelTLS TaskParallelTLS |
Per-thread specific data passed to the callback.
| typedef struct TaskPool TaskPool |
Definition at line 60 of file BLI_task.h.
| typedef void(* TaskRunFunction) (TaskPool *__restrict pool, void *taskdata) |
Definition at line 61 of file BLI_task.h.
| enum eTaskPriority |
| Enumerator | |
|---|---|
| TASK_PRIORITY_LOW | |
| TASK_PRIORITY_HIGH | |
Definition at line 55 of file BLI_task.h.
| BLI_INLINE void BLI_parallel_mempool_settings_defaults | ( | TaskParallelSettings * | settings | ) |
Definition at line 238 of file BLI_task.h.
Referenced by armature_deform_coords_impl(), bm_mesh_calc_tessellation__multi_threaded(), bm_mesh_loops_calc_normals__multi_threaded(), BM_mesh_normals_update_ex(), bm_mesh_verts_calc_normals(), lattice_deform_coords_impl(), TEST(), and TEST().
| BLI_INLINE void BLI_parallel_range_settings_defaults | ( | TaskParallelSettings * | settings | ) |
TODO(sergey): Think of a better place for this.
Definition at line 230 of file BLI_task.h.
Referenced by apply_shear_value(), apply_value_impl(), applyPushPull(), applyResize(), applyRotationValue(), applyShrinkFatten(), applySkinResize(), applyToSphere(), applyTrackballValue(), applyTranslationValue(), armature_deform_coords_impl(), Bend(), BKE_autotrack_context_step(), BKE_maskrasterize_buffer(), BKE_scopes_update(), BKE_tracking_stabilize_frame(), BLI_bvhtree_overlap_ex(), BLI_covariance_m_vn_ex(), BM_loop_interp_multires_ex(), bm_mesh_calc_tessellation_with_partial__multi_threaded(), BM_mesh_normals_update_with_partial_ex(), bm_mesh_select_mode_flush_edge_to_face(), bm_mesh_select_mode_flush_vert_to_edge(), brush_add(), ccgDM_copyFinalCornerEdgeArray(), ccgDM_copyFinalCornerVertArray(), ccgSubSurf__calcSubdivLevel(), ccgSubSurf__calcVertNormals(), cloth_bvh_objcollisions_nearcheck(), cloth_bvh_selfcollisions_nearcheck(), displaceModifier_do(), dynamicPaint_applySurfaceDisplace(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_createUVSurface(), dynamicPaint_doBorderStep(), dynamicPaint_doEffectStep(), dynamicPaint_doStep(), dynamicPaint_doWaveStep(), dynamicPaint_generateBakeData(), dynamicPaint_Modifier_apply(), dynamicPaint_outputSurfaceImage(), dynamicPaint_paintMesh(), dynamicPaint_paintParticles(), dynamicPaint_paintSinglePoint(), dynamicPaint_prepareAdjacencyData(), dynamicPaint_prepareEffectStep(), dynamicPaint_setInitialColor(), dynamics_step(), foreach_grid_coordinate(), foreach_mouse_hit_key(), blender::bke::subdiv::foreach_subdiv_geometry(), get_vert2geom_distance(), IMB_colormanagement_imbuf_to_float_texture(), IMB_processor_apply_threaded_scanlines(), lattice_deform_coords_impl(), lineart_build_edge_neighbor(), lineart_geometry_object_load(), lineart_main_transform_and_add_shadow(), blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), meshdeformModifier_do(), modify_mesh(), multiresModifier_disp_run(), non_recursive_bvh_div_nodes(), paint_2d_op(), PE_apply_lengths(), pe_deflect_emitter(), pe_iterate_lengths(), psys_cache_edit_paths(), RE_point_density_sample(), recount_totsel(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), SimpleDeformModifier_do(), surfacedeformBind(), surfacedeformModifier_do(), surfaceGenerateGrid(), and TEST().
| struct TaskGraph * BLI_task_graph_create | ( | void | ) |
Definition at line 102 of file task_graph.cc.
Referenced by DRW_draw_depth_object(), drw_task_graph_init(), TEST(), TEST(), TEST(), TEST(), and TEST().
Definition at line 143 of file task_graph.cc.
References BLI_task_scheduler_num_threads(), and TaskNode::successors.
Referenced by blender::draw::mesh_buffer_cache_create_requested(), TEST(), TEST(), TEST(), TEST(), and TEST().
| void BLI_task_graph_free | ( | struct TaskGraph * | task_graph | ) |
Definition at line 107 of file task_graph.cc.
Referenced by DRW_draw_depth_object(), drw_task_graph_deinit(), TEST(), TEST(), TEST(), TEST(), and TEST().
| struct TaskNode * BLI_task_graph_node_create | ( | struct TaskGraph * | task_graph, |
| TaskGraphNodeRunFunction | run, | ||
| void * | user_data, | ||
| TaskGraphNodeFreeFunction | free_func ) |
Definition at line 121 of file task_graph.cc.
References free_func(), and TaskGraph::nodes.
Referenced by blender::draw::mesh_buffer_cache_create_requested(), TEST(), TEST(), TEST(), TEST(), and TEST().
| bool BLI_task_graph_node_push_work | ( | struct TaskNode * | task_node | ) |
Definition at line 131 of file task_graph.cc.
References BLI_task_scheduler_num_threads(), and TaskNode::run_serial().
Referenced by blender::draw::mesh_buffer_cache_create_requested(), TEST(), TEST(), TEST(), TEST(), and TEST().
| void BLI_task_graph_work_and_wait | ( | struct TaskGraph * | task_graph | ) |
Definition at line 112 of file task_graph.cc.
References UNUSED_VARS.
Referenced by DRW_draw_depth_object(), blender::draw::drw_mesh_batch_cache_check_available(), blender::draw::DRW_mesh_batch_cache_create_requested(), drw_task_graph_deinit(), blender::draw::mesh_buffer_cache_create_requested(), TEST(), TEST(), TEST(), TEST(), and TEST().
| void BLI_task_isolate | ( | void(* | func )(void *userdata), |
| void * | userdata ) |
Definition at line 70 of file task_scheduler.cc.
Referenced by add_ibuf_for_tile(), bvhtree_balance(), modify_mesh(), and psys_update_particle_bvhtree().
| void BLI_task_parallel_mempool | ( | struct BLI_mempool * | mempool, |
| void * | userdata, | ||
| TaskParallelMempoolFunc | func, | ||
| const TaskParallelSettings * | settings ) |
This function allows to parallelize for loops over Mempool items.
| mempool | The iterable BLI_mempool to loop over. |
| userdata | Common userdata passed to all instances of func. |
| func | Callback function. |
| settings | See public API doc of TaskParallelSettings for description of all settings. |
Definition at line 55 of file task_iterator.c.
References BLI_mempool_iternew(), BLI_mempool_iterstep(), BLI_mempool_len(), BLI_task_pool_create(), BLI_task_pool_free(), BLI_task_pool_push(), BLI_task_pool_work_and_wait(), BLI_task_scheduler_num_threads(), MALLOCA, MALLOCA_FREE, mempool_iter_threadsafe_create(), mempool_iter_threadsafe_destroy(), NULL, parallel_mempool_func(), state, task_pool, TASK_PRIORITY_HIGH, ParallelMempoolTaskData::tls, UNLIKELY, and TaskParallelTLS::userdata_chunk.
Referenced by armature_deform_coords_impl(), lattice_deform_coords_impl(), TEST(), and TEST().
| void BLI_task_parallel_range | ( | int | start, |
| int | stop, | ||
| void * | userdata, | ||
| TaskParallelRangeFunc | func, | ||
| const TaskParallelSettings * | settings ) |
Definition at line 99 of file task_range.cc.
References BLI_task_scheduler_num_threads(), range, blender::lazy_threading::send_hint(), and TaskParallelTLS::userdata_chunk.
Referenced by apply_shear_value(), apply_value_impl(), applyPushPull(), applyResize(), applyRotationValue(), applyShrinkFatten(), applySkinResize(), applyToSphere(), applyTrackballValue(), applyTranslationValue(), armature_deform_coords_impl(), Bend(), BKE_autotrack_context_step(), BKE_maskrasterize_buffer(), BKE_scopes_update(), BKE_tracking_stabilize_frame(), BLI_bvhtree_overlap_ex(), BLI_covariance_m_vn_ex(), BM_loop_interp_multires_ex(), bm_mesh_calc_tessellation_with_partial__multi_threaded(), BM_mesh_normals_update_with_partial_ex(), brush_add(), ccgDM_copyFinalCornerEdgeArray(), ccgDM_copyFinalCornerVertArray(), ccgSubSurf__calcSubdivLevel(), ccgSubSurf__calcVertNormals(), cloth_bvh_objcollisions_nearcheck(), cloth_bvh_selfcollisions_nearcheck(), displaceModifier_do(), dynamicPaint_applySurfaceDisplace(), dynamicPaint_brushMeshCalculateVelocity(), dynamicPaint_createUVSurface(), dynamicPaint_doBorderStep(), dynamicPaint_doEffectStep(), dynamicPaint_doStep(), dynamicPaint_doWaveStep(), dynamicPaint_generateBakeData(), dynamicPaint_Modifier_apply(), dynamicPaint_outputSurfaceImage(), dynamicPaint_paintMesh(), dynamicPaint_paintParticles(), dynamicPaint_paintSinglePoint(), dynamicPaint_prepareAdjacencyData(), dynamicPaint_prepareEffectStep(), dynamicPaint_setInitialColor(), dynamics_step(), foreach_grid_coordinate(), foreach_mouse_hit_key(), blender::bke::subdiv::foreach_subdiv_geometry(), get_vert2geom_distance(), IMB_colormanagement_imbuf_to_float_texture(), IMB_processor_apply_threaded_scanlines(), lattice_deform_coords_impl(), lineart_build_edge_neighbor(), lineart_geometry_object_load(), lineart_main_transform_and_add_shadow(), blender::ed::sculpt_paint::load_tex(), blender::ed::sculpt_paint::load_tex_cursor(), meshdeformModifier_do(), modify_mesh(), multiresModifier_disp_run(), non_recursive_bvh_div_nodes(), paint_2d_op(), PE_apply_lengths(), pe_deflect_emitter(), pe_iterate_lengths(), psys_cache_edit_paths(), RE_point_density_sample(), shrinkwrap_calc_nearest_surface_point(), shrinkwrap_calc_nearest_vertex(), shrinkwrap_calc_normal_projection(), SimpleDeformModifier_do(), surfacedeformBind(), surfacedeformModifier_do(), surfaceGenerateGrid(), and TEST().
| int BLI_task_parallel_thread_id | ( | const TaskParallelTLS * | tls | ) |
Don't use this, store any thread specific data in tls->userdata_chunk instead. Only here for code to be removed.
Definition at line 139 of file task_range.cc.
References atomic_fetch_and_add_int32(), BLENDER_MAX_THREADS, and BLI_assert_msg.
Referenced by brush_add_count_iter(), blender::ed::sculpt_paint::calc_brush_texture_factors(), blender::ed::sculpt_paint::calc_brush_texture_factors(), blender::ed::sculpt_paint::load_tex_task_cb_ex(), and blender::compositor::threading_model_task_execute().
| void BLI_task_pool_cancel | ( | TaskPool * | pool | ) |
Cancel all tasks, keep worker threads running.
Definition at line 486 of file task_pool.cc.
References background_task_pool_cancel(), TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, tbb_task_pool_cancel(), and TaskPool::type.
Referenced by filelist_cache_previews_clear(), and preview_startjob().
| TaskPool * BLI_task_pool_create | ( | void * | userdata, |
| eTaskPriority | priority ) |
Regular task pool that immediately starts executing tasks as soon as they are pushed, either on the current or another thread.
Tasks will be executed as soon as they are added.
Definition at line 394 of file task_pool.cc.
References task_pool_create_ex(), and TASK_POOL_TBB.
Referenced by BKE_editmesh_loop_tangent_calc(), BKE_lib_override_library_main_operations_create(), BKE_mesh_calc_loop_tangent_ex(), BLI_task_parallel_mempool(), distribute_particles_on_dm(), do_sequence_proxy(), IMB_processor_apply_threaded(), lineart_main_add_triangles(), lineart_main_load_geometries(), lineart_main_occlusion_begin(), preview_startjob(), psys_cache_child_paths(), screen_opengl_render_init(), start_prefetch_threads(), blender::compositor::threading_model_task_start(), and blender::gpu::VKShaderCompiler::VKShaderCompiler().
| TaskPool * BLI_task_pool_create_background | ( | void * | userdata, |
| eTaskPriority | priority ) |
Background: always run tasks in a background thread, never immediately execute them. For running background jobs.
Definition at line 399 of file task_pool.cc.
References TASK_POOL_BACKGROUND, and task_pool_create_ex().
Referenced by filelist_cache_preview_ensure_running(), and undomesh_from_editmesh().
| TaskPool * BLI_task_pool_create_background_serial | ( | void * | userdata, |
| eTaskPriority | priority ) |
Background Serial: run tasks one after the other in the background.
Executes one task after the other, possibly on different threads but never in parallel.
Definition at line 426 of file task_pool.cc.
References TASK_POOL_BACKGROUND_SERIAL, and task_pool_create_ex().
Referenced by screen_opengl_render_init().
| TaskPool * BLI_task_pool_create_no_threads | ( | void * | userdata | ) |
No threads: immediately executes tasks on the same thread. For debugging purposes.
Definition at line 421 of file task_pool.cc.
References task_pool_create_ex(), TASK_POOL_NO_THREADS, and TASK_PRIORITY_HIGH.
| TaskPool * BLI_task_pool_create_suspended | ( | void * | userdata, |
| eTaskPriority | priority ) |
Suspended: don't execute tasks until work_and_wait is called. This is slower as threads can't immediately start working. But it can be used if the data structures the threads operate on are not fully initialized until all tasks are created.
Definition at line 413 of file task_pool.cc.
References task_pool_create_ex(), and TASK_POOL_TBB_SUSPENDED.
Referenced by project_paint_op(), and TEST().
| bool BLI_task_pool_current_canceled | ( | TaskPool * | pool | ) |
For worker threads, test if current task pool canceled. this function may only be called from worker threads and pool must be the task pool that the thread is currently executing a task from.
Definition at line 501 of file task_pool.cc.
References background_task_pool_canceled(), BLI_assert_msg, TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, tbb_task_pool_canceled(), and TaskPool::type.
Referenced by execute_read_sound_waveform_task().
| void BLI_task_pool_free | ( | TaskPool * | pool | ) |
Definition at line 431 of file task_pool.cc.
References background_task_pool_free(), BLI_mutex_end(), MEM_freeN(), TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, tbb_task_pool_free(), TaskPool::type, and TaskPool::user_mutex.
Referenced by BKE_editmesh_loop_tangent_calc(), BKE_lib_override_library_main_operations_create(), BKE_mesh_calc_loop_tangent_ex(), BLI_task_parallel_mempool(), blender::deg::deg_evaluate_on_refresh(), distribute_particles_on_dm(), do_sequence_proxy(), filelist_cache_previews_free(), IMB_processor_apply_threaded(), lineart_main_add_triangles(), lineart_main_load_geometries(), lineart_main_occlusion_begin(), preview_startjob(), project_paint_op(), psys_cache_child_paths(), screen_opengl_render_end(), start_prefetch_threads(), TEST(), blender::compositor::threading_model_task_stop(), um_arraystore_free(), blender::fn::lazy_function::Executor::~Executor(), and blender::gpu::VKShaderCompiler::~VKShaderCompiler().
| void BLI_task_pool_push | ( | TaskPool * | pool, |
| TaskRunFunction | run, | ||
| void * | taskdata, | ||
| bool | free_taskdata, | ||
| TaskFreeFunction | freedata ) |
Definition at line 450 of file task_pool.cc.
References background_task_pool_run(), TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, tbb_task_pool_run(), and TaskPool::type.
Referenced by blender::gpu::VKShaderCompiler::batch_compile(), BKE_editmesh_loop_tangent_calc(), BKE_lib_override_library_main_operations_create(), BKE_mesh_calc_loop_tangent_ex(), BLI_task_parallel_mempool(), distribute_particles_on_dm(), do_sequence_proxy(), filelist_cache_previews_push(), IMB_processor_apply_threaded(), lineart_main_add_triangles(), lineart_main_load_geometries(), lineart_main_occlusion_begin(), project_paint_op(), psys_cache_child_paths(), push_preview_job_audio_task(), schedule_write_result(), start_prefetch_threads(), TEST(), blender::compositor::threading_model_task_schedule(), and undomesh_from_editmesh().
| void * BLI_task_pool_user_data | ( | TaskPool * | pool | ) |
Optional userdata pointer to pass along to run function.
Definition at line 516 of file task_pool.cc.
References TaskPool::userdata.
Referenced by filelist_cache_preview_runf(), lib_override_library_operations_create_cb(), parallel_mempool_func(), prefetch_task_func(), processor_apply_func(), proxy_task_func(), and write_result().
| ThreadMutex * BLI_task_pool_user_mutex | ( | TaskPool * | pool | ) |
Optional mutex to use from run function.
Definition at line 521 of file task_pool.cc.
References TaskPool::user_mutex.
| void BLI_task_pool_work_and_wait | ( | TaskPool * | pool | ) |
Work and wait until all tasks are done.
Definition at line 471 of file task_pool.cc.
References background_task_pool_work_and_wait(), TASK_POOL_BACKGROUND, TASK_POOL_BACKGROUND_SERIAL, TASK_POOL_NO_THREADS, TASK_POOL_TBB, TASK_POOL_TBB_SUSPENDED, tbb_task_pool_work_and_wait(), and TaskPool::type.
Referenced by BKE_editmesh_loop_tangent_calc(), BKE_lib_override_library_main_operations_create(), BKE_mesh_calc_loop_tangent_ex(), BLI_task_parallel_mempool(), distribute_particles_on_dm(), do_sequence_proxy(), blender::fn::lazy_function::Executor::execute(), IMB_processor_apply_threaded(), lineart_main_add_triangles(), lineart_main_load_geometries(), lineart_main_occlusion_begin(), preview_startjob(), project_paint_op(), psys_cache_child_paths(), screen_opengl_render_end(), start_prefetch_threads(), TEST(), blender::compositor::threading_model_task_finish(), undomesh_free_data(), undomesh_from_editmesh(), undomesh_to_editmesh(), and blender::gpu::VKShaderCompiler::~VKShaderCompiler().
| void BLI_task_scheduler_exit | ( | void | ) |
Definition at line 58 of file task_scheduler.cc.
Referenced by WM_exit_ex().
| void BLI_task_scheduler_init | ( | void | ) |
Definition at line 34 of file task_scheduler.cc.
References BLI_system_num_threads_override_get(), BLI_system_thread_count(), task_scheduler_num_threads, and threads_override_num.
Referenced by main(), and blender::fn::lazy_function::tests::TEST().
| int BLI_task_scheduler_num_threads | ( | void | ) |
Definition at line 65 of file task_scheduler.cc.
References task_scheduler_num_threads.
Referenced by BLI_task_graph_edge_create(), BLI_task_graph_node_push_work(), BLI_task_parallel_mempool(), BLI_task_parallel_range(), do_sequence_proxy(), blender::threading::detail::memory_bandwidth_bound_task_impl(), start_prefetch_threads(), and task_pool_create_ex().