Recent spinlock commit made scheduling unsafe for threading
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Aug 2013 09:24:15 +0000 (09:24 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Aug 2013 09:24:15 +0000 (09:24 +0000)
commit5be97aba95d34e49d78897b3b77e3596d3cbb298
tree90adaf6d0e391e9bf6d037f3885ddb730791f170
parent932df91cbd816b9d0a0e78cfe8c258014d9309b5
Recent spinlock commit made scheduling unsafe for threading

Namely, it caused nodes be adding to the pool multiple times.

Returned spin back, but use it only in cases node valency is
zero. So now valency is decreasing without any locks, then
if it's zero spin lock happens, node color (which indicates
whether node is scheduled or not) happens. Actual new task
creation happens outside of locks.

This might sound a bit complicated, but it's straightforward
code which is free from any thread synchronization latency.
source/blender/blenkernel/BKE_depsgraph.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/windowmanager/intern/wm_playanim.c
source/creator/creator.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp