Blender Git Loki

Git Commits -> Revision c847198

Revision c847198 by Sergey Sharybin (master)
July 31, 2013, 21:55 (GMT)
Use one global task scheduler for all the tasks

Instead of allocating scheduler and starting threads
on every object_update call make it so scheduler is
global and threads are always ready to run.

This was we could avoid quite hacky thing which is
counting how much objects need to be updated before
starting threaded update.

It'll also allow using the same scheduler to do all
sorts of tasks, not only objects update in the same
scheduler. This is nice from load balancing point of
view.

Couple of changes were needed to be done in task
scheduler itself:

- Free tas before sending notifier.
- Free TaskThread structures outside from thread.

This is needed to make it possible use begin/end
threaded malloc from the main thread before/after
running the pool. Without this change it was possible
that allocation will switch to non-thread mode while
thread is freeing the task.

This required storing TaskThread array in Scheduler,
but it's not so much bad actually, since it also
reduces memory overhead caused by per-thread allocation.

Commit Details:

Full Hash: c847198a7b136f48951ae0e788be347d7eb048cf
SVN Revision: 58788
Parent Commit: 853f2e0
Lines Changed: +47, -73

5 Modified Paths:

/source/blender/blenkernel/intern/scene.c (+9, -64) (Diff)
/source/blender/blenlib/BLI_threads.h (+4, -0) (Diff)
/source/blender/blenlib/intern/task.c (+14, -7) (Diff)
/source/blender/blenlib/intern/threads.c (+16, -1) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+4, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021