Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-05-09 18:01:40 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-05-09 18:17:20 +0300
commit633fee72d5cb4c1f3136781561a72deb301a44d7 (patch)
treed674a0aa80bbad72bea9a5dca9ea849ebb508d4b /source/blender/blenlib/BLI_task.h
parent9be28095cba4fdff77626f54d61afb0acdd2f9dd (diff)
Fix T76427: edit mesh undo hanges when building without TBB
Background task pools would not restart threads if reused multiple times, thanks to Jeroen for identifying the cause of this problem. Differential Revision: https://developer.blender.org/D7659
Diffstat (limited to 'source/blender/blenlib/BLI_task.h')
-rw-r--r--source/blender/blenlib/BLI_task.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h
index 3ef693ac62a..64dfdc2ad25 100644
--- a/source/blender/blenlib/BLI_task.h
+++ b/source/blender/blenlib/BLI_task.h
@@ -49,7 +49,7 @@ int BLI_task_scheduler_num_threads(void);
/* Task Pool
*
- * Pool of tasks that will be executed by the central TaskScheduler. For each
+ * 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.
*
@@ -70,11 +70,27 @@ typedef struct TaskPool TaskPool;
typedef void (*TaskRunFunction)(TaskPool *__restrict pool, void *taskdata);
typedef void (*TaskFreeFunction)(TaskPool *__restrict pool, void *taskdata);
+/* Regular task pool that immediately starts executing tasks as soon as they
+ * are pushed, either on the current or another thread. */
TaskPool *BLI_task_pool_create(void *userdata, TaskPriority priority);
+
+/* Background: always run tasks in a background thread, never immediately
+ * execute them. For running background jobs. */
TaskPool *BLI_task_pool_create_background(void *userdata, TaskPriority priority);
+
+/* Background Serial: run tasks one after the other in the background,
+ * without parallelization between the tasks. */
+TaskPool *BLI_task_pool_create_background_serial(void *userdata, TaskPriority 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. */
TaskPool *BLI_task_pool_create_suspended(void *userdata, TaskPriority priority);
+
+/* No threads: immediately executes tasks on the same thread. For debugging. */
TaskPool *BLI_task_pool_create_no_threads(void *userdata);
-TaskPool *BLI_task_pool_create_background_serial(void *userdata, TaskPriority priority);
+
void BLI_task_pool_free(TaskPool *pool);
void BLI_task_pool_push(TaskPool *pool,