Blender Git Loki

Git Commits -> Revision 033d395

Revision 033d395 by Sergey Sharybin (master)
August 12, 2013, 14:37 (GMT)
Use atomic operations instead of spin lock for threaded update

This replaces code (pseudo-code):

spin_lock();
update_child_dag_nodes();
schedule_new_nodes();
spin_unlock();

with:

update_child_dag_nodes_with_atomic_ops();
schedule_new_nodes();

The reason for this is that scheduling new nodes implies
mutex lock, and having spin around it is a bad idea.

Alternatives could have been to use spinlock around
child nodes update only, but that would either imply having
either per-node spin-lock or using array to put nodes
ready for update to an array.

Didn't like an alternatives, using atomic operations makes
code much easier to follow, keeps data-flow on cpu nice.

Same atomic ops might be used in other performance-critical
areas later.

Using atomic ops implementation from jemalloc project.

Commit Details:

Full Hash: 033d395bede8849198761c190d0d7e93a95e4313
SVN Revision: 59086
Parent Commit: 983cc7c
Lines Changed: +301, -14

Tehnyt: Miika HämäläinenViimeksi p?ivitetty: 07.11.2014 14:18 MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021