156 WorkPackage *
package = static_cast<WorkPackage *>(task_data);
159 device.execute(package);
void BLI_task_pool_work_and_wait(TaskPool *pool)
TaskPool * BLI_task_pool_create(void *userdata, eTaskPriority priority)
int BLI_task_parallel_thread_id(const TaskParallelTLS *tls)
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_thread_queue_push(ThreadQueue *queue, void *work)
void * BLI_thread_queue_pop(ThreadQueue *queue)
#define BLI_thread_local_create(name)
#define BLI_thread_local_set(name, value)
ThreadQueue * BLI_thread_queue_init(void)
#define BLI_thread_local_delete(name)
void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot)
void BLI_thread_queue_free(ThreadQueue *queue)
#define BLI_thread_local_get(name)
void BLI_threadpool_end(struct ListBase *threadbase)
#define ThreadLocal(type)
void BLI_thread_queue_nowait(ThreadQueue *queue)
void BLI_thread_queue_wait_finish(ThreadQueue *queue)
void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata)
Read Guarded memory(de)allocation.
class representing a CPU device.
void execute(WorkPackage *work) override
execute a WorkPackage
Abstract class for device implementations to be used by the Compositor. devices are queried,...
static void threading_model_task_execute(TaskPool *__restrict, void *task_data)
static void threading_model_queue_deinitialize()
constexpr ThreadingModel COM_threading_model()
static void threading_model_single_thread_execute(WorkPackage *package)
static void threading_model_queue_stop()
ListBase threads
list of all thread for every CPUDevice in cpudevices a thread exists.
static void threading_model_queue_initialize(const int num_cpu_threads)
static void threading_model_queue_schedule(WorkPackage *package)
static void threading_model_task_stop()
static struct blender::compositor::@172 g_work_scheduler
static void threading_model_queue_start()
static void * threading_model_queue_execute(void *data)
struct blender::compositor::@172::@174 task
static void threading_model_task_start()
static void threading_model_task_finish()
static void threading_model_queue_finish()
Vector< CPUDevice > devices
list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
static void threading_model_task_schedule(WorkPackage *package)
ThreadQueue * queue
all scheduled work for the cpu
contains data about work that can be scheduled
static void start()
Start the execution this methods will start the WorkScheduler. Inside this method all threads are ini...
static int get_num_cpu_threads()
static void schedule(WorkPackage *package)
schedule a chunk of a group to be calculated. An execution group schedules a chunk in the WorkSchedul...
static void deinitialize()
deinitialize the WorkScheduler free all allocated resources
static void finish()
wait for all work to be completed.
static void stop()
stop the execution All created thread by the start method are destroyed.
static void initialize(int num_cpu_threads)
initialize the WorkScheduler
static int current_thread_id()